1. 程式人生 > >java.lang.NoClassDefFoundError: javax/transaction/TransactionManager 解決 只需一個jta.jar檔案

java.lang.NoClassDefFoundError: javax/transaction/TransactionManager 解決 只需一個jta.jar檔案

早上上班開啟電腦,發現應用啟動出問題了,提示:java.lang.NoClassDefFoundError: javax/transaction/TransactionManager, 於是google了一下,原來是少了jta.jar。奇怪,原來好好的,今天怎麼少了呢? 是不是我Eclipse出問題了。

jta.jar 下載地址:

具體出錯資訊如下:

  1. Caused by: 
  2. java.lang.NoClassDefFoundError: javax/transaction/TransactionManager
  3.     at java.lang.Class.getDeclaredMethods0(Native Method)
  4.     at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
  5.     at java.lang.Class.getDeclaredMethods(Class.java:1763)
  6.     at java.beans.Introspector$1.run(Introspector.java:1265)
  7.     at java.security.AccessController.doPrivileged(Native Method)
  8.     at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:
    1263)
  9.     at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1129)
  10.     at java.beans.Introspector.getBeanInfo(Introspector.java:387)
  11.     at java.beans.Introspector.getBeanInfo(Introspector.java:159)
  12.     at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:
    142)
  13.     at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:83)
  14.     at org.springframework.beans.BeanWrapperImpl.setIntrospectionClass(BeanWrapperImpl.java:239)
  15.     at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:197)
  16.     at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:180)
  17.     at org.springframework.beans.BeanWrapperImpl.<init>(BeanWrapperImpl.java:133)
  18.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:535)
  19.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375)
  20.     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
  21.     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
  22.     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
  23.     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
  24.     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:246)
  25.     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)
  26.     at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:332)
  27.     at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:97)
  28.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:578)
  29.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:371)
  30.     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
  31.     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
  32.     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
  33.     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
  34.     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:246)
  35.     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)
  36.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:850)
  37.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:624)
  38.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:411)
  39.     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
  40.     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
  41.     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
  42.     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
  43.     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:304)
  44.     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
  45.     at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
  46.     at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
  47.     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
  48.     at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)
  49.     at javax.servlet.GenericServlet.init(GenericServlet.java:211)
  50.     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
  51.     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
  52.     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951)
  53.     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225)
  54.     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
  55.     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
  56.     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
  57.     at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
  58.     at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
  59.     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
  60.     at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
  61.     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
  62.     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
  63.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
  64.     at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
  65.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
  66.     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
  67.     at org.apache.catalina.core.StandardService.start(StandardService.java:450)
  68.     at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
  69.     at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
  70.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  71.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  72.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  73.     at java.lang.reflect.Method.invoke(Method.java:585)
  74.     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
  75.     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)