Hi,
Apologies, this is probably a total noob question
We have a SpringMVC webapp that runs ok under JBoss, but fails under tomcat.
I first got this error:
NoClassDefFoundError: javax/transaction/Synchronization
Which I fixed by putting the jta.jar into the common/lib directory, but then get this error:Code:15:12:57,201 INFO [XmlWebApplicationContext] Refreshing org.springframework.web.context.support.XmlWebApplicationContex t@153f67e: display name [Root WebApplicationContext]; startup date [Fri Aug 17 15:12:57 BST 2007]; root of context hiera rchy 15:12:57,264 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applica tionContext.xml] 15:12:57,357 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/commonS pringContext.xml] 15:12:57,436 INFO [XmlWebApplicationContext] Bean factory for application context [org.springframework.web.context.supp ort.XmlWebApplicationContext@153f67e]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1cf4a2c 15:12:57,545 INFO [XmlWebApplicationContext] Bean 'org.springframework.aop.config.internalAutoProxyCreator' is not elig ible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 15:12:57,576 INFO [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.Defau ltListableBeanFactory@1cf4a2c: defining beans [transactionManager,transactionTemplate,org.springframework.aop.config.int ernalAutoProxyCreator,org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor,simpleJdbcTemplate,j dbcTemplate,namedParameterJdbcTemplate,systemUserDao,mithrasCacheDao,referenceDataDao,instrumentDao,portfolioDao,sophisC ommonDao,requestHandler,instrumentDaoMithras,greeksDao,utilitiesDao,systemVersionDaoMithras,systemUserManager,templateDa o,tradeDao,mithrasInstrumentManager,mithrasGreeksManager,mithrasUtilitiesManager,instrumentManager,templateManager,signo nInterceptor,systemVersionManager,startup,messageSource,viewResolver,urlMapping,exceptionResolver,changeResult,applicati onProperties,instrumentPricer,entityManagerFactory,dataSource]; root of factory hierarchy 15:12:57,576 ERROR [ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction. interceptor.TransactionAttributeSourceAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.tra nsaction.interceptor.TransactionInterceptor] while setting bean property 'transactionInterceptor'; nested exception is o rg.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve ref erence to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springfram ework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/commonSpringContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/Synchronization Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve re ference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springfra mework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/commonSpringContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoun dError: javax/transaction/Synchronization Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in S ervletContext resource [/WEB-INF/commonSpringContext.xml]: Instantiation of bean failed; nested exception is java.lang.N oClassDefFoundError: javax/transaction/Synchronization Caused by: java.lang.NoClassDefFoundError: javax/transaction/Synchronization at java.lang.Class.getDeclaredConstructors0(Native Method)
IllegalStateException: Either 'userTransaction' or 'userTransactionName' or 'transactionManager' or 'transacti
onManagerName' must be specified
Which was an error we were getting with the JBoss version, until I removed the jta.jar from the webapp - seems like it clashed with the JBoss version.Code:15:14:22,951 INFO [XmlWebApplicationContext] Refreshing org.springframework.web.context.support.XmlWebApplicationContex t@153f67e: display name [Root WebApplicationContext]; startup date [Fri Aug 17 15:14:22 BST 2007]; root of context hiera rchy 15:14:23,014 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applica tionContext.xml] 15:14:23,107 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/commonS pringContext.xml] 15:14:23,186 INFO [XmlWebApplicationContext] Bean factory for application context [org.springframework.web.context.supp ort.XmlWebApplicationContext@153f67e]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1cf4a2c 15:14:23,295 INFO [XmlWebApplicationContext] Bean 'org.springframework.aop.config.internalAutoProxyCreator' is not elig ible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 15:14:23,342 INFO [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.Defau ltListableBeanFactory@1cf4a2c: defining beans [transactionManager,transactionTemplate,org.springframework.aop.config.int ernalAutoProxyCreator,org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor,simpleJdbcTemplate,j dbcTemplate,namedParameterJdbcTemplate,systemUserDao,mithrasCacheDao,referenceDataDao,instrumentDao,portfolioDao,sophisC ommonDao,requestHandler,instrumentDaoMithras,greeksDao,utilitiesDao,systemVersionDaoMithras,systemUserManager,templateDa o,tradeDao,mithrasInstrumentManager,mithrasGreeksManager,mithrasUtilitiesManager,instrumentManager,templateManager,signo nInterceptor,systemVersionManager,startup,messageSource,viewResolver,urlMapping,exceptionResolver,changeResult,applicati onProperties,instrumentPricer,entityManagerFactory,dataSource]; root of factory hierarchy 15:14:23,342 ERROR [ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction. interceptor.TransactionAttributeSourceAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.tra nsaction.interceptor.TransactionInterceptor] while setting bean property 'transactionInterceptor'; nested exception is o rg.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve ref erence to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springfram ework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/commonSpringContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStat eException: Either 'userTransaction' or 'userTransactionName' or 'transactionManager' or 'transactionManagerName' must b e specified Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve re ference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springfra mework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/commonSpringContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalSta teException: Either 'userTransaction' or 'userTransactionName' or 'transactionManager' or 'transactionManagerName' must be specified Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in S ervletContext resource [/WEB-INF/commonSpringContext.xml]: Invocation of init method failed; nested exception is java.la ng.IllegalStateException: Either 'userTransaction' or 'userTransactionName' or 'transactionManager' or 'transactionManag erName' must be specified Caused by: java.lang.IllegalStateException: Either 'userTransaction' or 'userTransactionName' or 'transactionManager' or 'transacti onManagerName' must be specified at org.springframework.transaction.jta.JtaTransactionManager.initUserTransactionAndTransactionManager(JtaTransac tionManager.java:458) at org.springframework.transaction.jta.JtaTransactionManager.afterPropertiesSet(JtaTransactionManager.java:407) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowi reCapableBeanFactory.java:1201) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireC apableBeanFactory.java:1171) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapab leBeanFactory.java:425)
Any tips on getting it to run with tomcat.
Thanks in advance,
Chris



Reply With Quote
