java.lang.ClassNotFoundException: org.springframework.transaction.TransactionException

Developing Quartz with Spring 3, and hits following error message.


Caused by: 
       java.lang.NoClassDefFoundError: org/springframework/transaction/TransactionException
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
	at java.lang.Class.getConstructor0(Class.java:2699)
	at java.lang.Class.getDeclaredConstructor(Class.java:1985)
        .....
Caused by: java.lang.ClassNotFoundException: org.springframework.transaction.TransactionException
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
	... 29 more

Solution

Doesn’t matter with Quartz, above error message show that you need Spring transaction dependency. To fix it, just include spring-tx.jar.

For example, pom.xml


   <dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-tx</artifactId>
	<version>3.1.2.RELEASE</version>
   </dependency>

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

Leave a Reply

avatar
newest oldest most voted
Latest Tutorials
Guest
Latest Tutorials

First thing u need to check missing Spring-JDBC module in pom

org.springframework
spring-jdbc
${org.springframework-version}

Richhpal
Guest
Richhpal
Hi, During using webflow with authentication manager I got following error. Do you have any idea about that? Thanks in advance 2013-10-09 15:56:36,426 [localhost-startStop-1] ERROR org.springframework.web.context.ContextLoader – Context initialization failed java.lang.NoClassDefFoundError: org/springframework/transaction/interceptor/TransactionAspectSupport$InvocationCallback at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2521) at java.lang.Class.getDeclaredMethods(Class.java:1845) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:467) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:451) at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:511) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:644) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:575) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1344) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:356) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:327) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:435) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:624) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.ClassNotFoundException: org.springframework.transaction.interceptor.TransactionAspectSupport$InvocationCallback at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713) at… Read more »
madhavii
Guest
madhavii
I tried but unable to slove my issue plz help me. I tried but unable to slove my issue plz help me. I tried but unable to slove my issue plz help me. Dec 2, 2012 5:16:27 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext Dec 2, 2012 5:17:00 AM org.apache.catalina.core.ApplicationContext log INFO: Set web app root system property: ‘webapp.root’ = [D:\System User Program Files\Apache Software Foundation\Tomcat 7.0\webapps\akura\] Dec 2, 2012 5:17:00 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing log4j from [D:\System User Program Files\Apache Software Foundation\Tomcat 7.0\webapps\akura\WEB-INF\classes\log4j.xml] Dec 2, 2012 5:17:01 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet ‘akura’ Dec 2,… Read more »
jojobojo
Guest
jojobojo

my application is not using any maven configuration…we have only spring mvc and eclipse…need to implement the quartz scheduler…i have configuren the quatz job…..when i start the server it’s throwing the same exception…..Caused by: java.lang.NoClassDefFoundError: org/quartz/Job

please let me know the solution for this

thanks