3 Replies Latest reply: Apr 21, 2011 12:07 PM by Jean Mac RSS

java.lang.NoClassDefFoundError: javax/transaction/RollbackException

Jean Mac Newbie

Hi,

I migrating my app from WebLogic to JBoss AS 5.1.0 and I have deployed my app (an ear with 2 wars) to JBoss successfully. Now I am trying to run my existing integration tests and I got java.lang.NoClassDefFoundError: javax/transaction/RollbackException error when creating bean - transactionManager. see the below full stack trace.  I tried to add jta.jar but it then produce a new error with typemismatchexception for usertransaction. I did some diggings and found out it was class loader issue with jta.jar I added. so I removed it and now I am still facing this RollbackException not found issue.

 

Any ideas?? Thx

 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [applicationContext-test-transaction.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/RollbackException

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

    at java.security.AccessController.doPrivileged(Native Method)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)

    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)

    at org.springframework.test.AbstractSingleSpringContextTests.createApplicationContext(AbstractSingleSpringContextTests.java:213)

    at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:189)

    at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:169)

    at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:140)

    at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:98)

    at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)

    at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:108)

    at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:42)

    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:192)

    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:64)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)

Caused by: java.lang.NoClassDefFoundError: javax/transaction/RollbackException

    at java.lang.Class.getDeclaredConstructors0(Native Method)

    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)

    at java.lang.Class.getConstructor0(Class.java:2671)

    at java.lang.Class.getDeclaredConstructor(Class.java:1953)

    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:54)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)

    ... 35 more