[jboss-user] [JBoss/Spring Integration] - BeanCreationException on Jboss deploy but with Tomcat the de

sselda do-not-reply at jboss.com
Wed Nov 29 06:12:42 EST 2006


I have changed an existing web application (version 2.4) based on:

- JBoss 3.2.6
- Spring  1.2.8
- Struts 1.2.9

Before the changes the web app starts correctly.
I have modified a Struts Action adding an attribute and relatives get/set (the attribute class already exists, and it is already defined in a Spring XML descriptor), and I have modified the Spring XML descriptor.

Now, the application deploy crashes with the exception:

anonymous wrote : 
  | org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/geneGenric/DettaglioRicerca' defined in ServletContext resource [/WEB-INF/xml/spring/gene-genric.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'gruppiManager' of bean class [it.eldasoft.gene.web.struts.genric.DettaglioRicercaAction]: Bean property 'gruppiManager' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
  | org.springframework.beans.NotWritablePropertyException: Invalid property 'gruppiManager' of bean class [it.eldasoft.gene.web.struts.genric.DettaglioRicercaAction]: Bean property 'gruppiManager' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
  | 	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:670)
  | 	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:572)
  | 	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:737)
  | 	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:764)
  | 	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:753)
  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1057)
  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)
  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:378)
  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:283)
  | 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
  | 	at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)
  | 	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:252)
  | 	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
  | 	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
  | 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
  | 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
  | 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
  | 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
  | 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:324)
  | 	at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
  | 	at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:149)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
  | 	at org.apache.catalina.core.StandardContext.init(StandardContext.java:5441)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:324)
  | 	at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
  | 	at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:149)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
  | 	at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:316)
  | 	at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:76)
  | 	at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:320)
  | 	at org.jboss.web.WebModule.startModule(WebModule.java:62)
  | 	at org.jboss.web.WebModule.startService(WebModule.java:40)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:324)
  | 	at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
  | 	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)
  | 	at $Proxy18.start(Unknown Source)
  | 	at org.jboss.system.ServiceController.start(ServiceController.java:414)
  | 	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:324)
  | 	at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
  | 	at $Proxy35.start(Unknown Source)
  | 	at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:363)
  | 	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
  | 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
  | 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
  | 	at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:324)
  | 	at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
  | 	at $Proxy8.deploy(Unknown Source)
  | 	at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
  | 	at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:460)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
  | 

The strange is that in Tomcat 5.0.28 the application starts correctly!


The web.xml contains:


  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <web-app id="GENE_ID" version="2.4"
  | 	xmlns="http://java.sun.com/xml/ns/j2ee"
  | 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  | 	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  | 
  | 	<display-name>a display name</display-name>
  | 
  | 	<description>a description</description>
  | 
  | 	<filter>
  | 		<filter-name>ResponseOverrideFilter</filter-name>
  | 		<filter-class>
  | 			org.displaytag.filter.ResponseOverrideFilter
  | 		</filter-class>
  | 	</filter>
  | 
  | 	<filter-mapping>
  | 		<filter-name>ResponseOverrideFilter</filter-name>
  | 		<url-pattern>*.jsp</url-pattern>
  | 	</filter-mapping>
  | 
  | 	<filter-mapping>
  | 		<filter-name>ResponseOverrideFilter</filter-name>
  | 		<url-pattern>*.do</url-pattern>
  | 	</filter-mapping>
  | 
  | 		<context-param>
  | 		<param-name>contextConfigLocation</param-name>
  | 		<param-value>
  | 			/WEB-INF/xml/spring/application-context.xml,
  | 			/WEB-INF/xml/spring/gene-common.xml,
  | 			/WEB-INF/xml/spring/gene-admin.xml,
  | 			/WEB-INF/xml/spring/gene-genric.xml		</param-value>
  | 	</context-param>
  | 
  | 
  | ...
  | 

gene-admin.xml is not changed, and contains the declaration of gruppiManager:


  | 	<bean id="gruppiManagerTransactionProxy"
  | 		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
  | 		abstract="true" >
  | 		<property name="transactionManager" ref="transactionManager" />
  | 		<property name="transactionAttributes" >
  | 			<props>
  | 				<prop key="get*">PROPAGATION_NOT_SUPPORTED</prop>
  | 				<prop key="update*">PROPAGATION_REQUIRED</prop>
  | 				<prop key="delete*">PROPAGATION_REQUIRED</prop>
  | 				<prop key="insert*">PROPAGATION_REQUIRED</prop>
  | 			</props>
  | 		</property>
  | 	</bean>	
  | 
  | 	<bean id="gruppiManager" parent="gruppiManagerTransactionProxy">
  | 		<property name="target">
  | 			<bean class="it.eldasoft.gene.bl.admin.GruppiManager">
  | 				<property name="gruppiDao" ref="gruppiDao" />
  | 				<property name="genChiaviManager" ref="genChiaviManager"/>
  | 			</bean>
  | 		</property>
  | 	</bean>
  | 

gene-genric.xml is changed, and now the bean "/geneGenric/DettaglioRicerca" contains the set for gruppiManager, which it is already and correctly used in other declarations:


  | 	<bean name="/geneGenric/InitTrovaRicerche" class="it.eldasoft.gene.web.struts.genric.InitTrovaRicercheAction">
  | 		<property name="tabellatiManager" ref="tabellatiManager"/>
  | 		<property name="gruppiManager" ref="gruppiManager"/>
  | 
  | 	<bean name="/geneGenric/DettaglioRicerca" class="it.eldasoft.gene.web.struts.genric.DettaglioRicercaAction">
  | 		<property name="ricercheManager" ref="ricercheManager"/>
  | 		<property name="gruppiManager" ref="gruppiManager"/>
  | 	</bean>
  | 


DettaglioRicercaAction.java now contains:


  |   private GruppiManager    gruppiManager;
  | 
  |   public GruppiManager getGruppiManager() {
  |     return gruppiManager;
  |   }
  | 
  |   public void setGruppiManager(GruppiManager gruppiManager) {
  |     this.gruppiManager = gruppiManager;
  |   }
  | 
  | 

Any suggestion?

Thanks,
sselda

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989644#3989644

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989644



More information about the jboss-user mailing list