项目运行报java.lang.NoClassDefFoundError: org/springframework/web/context/ContextLoaderListen

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xianglingchuan/article/details/79731216

运行从Git上面拉下来的项目运行报java.lang.NoClassDefFoundError: org/springframework/web/context/ContextLoaderListener

严重: Error configuring application listener of class com.snaillove.web.cloudmusic.common.modules.listener.WebContextListener
java.lang.NoClassDefFoundError: org/springframework/web/context/ContextLoaderListener
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3205)
  at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1373)
  at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1861)
  at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
  at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:495)
  at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:477)
  at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5034)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
  at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
  at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
  ... 19 more

经过git对比发现是项目下的.classpath跟拉下来原始的内容有所改变导致,还原以后运行正常。

大体是同下部分有所改动导致:

  <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
    <attributes>
      <attribute name="maven.pomderived" value="true"/>
      <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
    </attributes>
  </classpathentry>
  <classpathentry kind="src" output="target/test-classes" path="src/test/java">
    <attributes>
      <attribute name="optional" value="true"/>
      <attribute name="maven.pomderived" value="true"/>
    </attributes>
  </classpathentry>
阅读更多

java.lang.NoClassDefFoundError: org/springframework/context/ApplicationListener

08-21

信息: Marking servlet CXFServlet as unavailablern八月 21, 2014 12:35:14 下午 org.apache.catalina.core.StandardContext loadOnStartuprn严重: Servlet /SunUST threw load() exceptionrnjava.lang.NoClassDefFoundError: org/springframework/context/ApplicationListenerrn at java.lang.ClassLoader.findBootstrapClass(Native Method)rn at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1062)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:413)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:411)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:357)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1617)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)rn at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)rn at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)rn at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:142)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1120)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1678)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:724)rn八月 21, 2014 12:35:14 下午 org.apache.coyote.AbstractProtocol startrn信息: Starting ProtocolHandler ["http-apr-8011"]rn八月 21, 2014 12:35:14 下午 org.apache.coyote.AbstractProtocol startrn信息: Starting ProtocolHandler ["ajp-apr-8009"]rn八月 21, 2014 12:35:14 下午 org.apache.catalina.startup.Catalina startrn信息: Server startup in 22761 msrn

java.lang.NoClassDefFoundError: org/springframework/web/context/support/GenericW

11-18

myeclipse6.0 tomcat6.0 struts2 rnrn启动时错误 用tomcat5的时候没有问题rnrn严重: Servlet /OMCR threw load() exceptionrnjava.lang.NoClassDefFoundError: org/springframework/web/context/support/GenericWebApplicationContextrn at java.lang.Class.getDeclaredConstructors0(Native Method)rn at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)rn at java.lang.Class.getConstructor0(Class.java:2699)rn at java.lang.Class.newInstance0(Class.java:326)rn at java.lang.Class.newInstance(Class.java:308)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)rn at org.apache.catalina.core.StandardService.start(StandardService.java:519)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:581)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

没有更多推荐了,返回首页