springmvc项目中java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

时间:2021-11-08 16:28:01

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4919)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
    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:652)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1948)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)
2016-6-12 8:58:33 org.apache.catalina.core.StandardContext listenerStart
严重: Skipped installing application listeners due to previous error(s)
2016-6-12 8:58:33 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
2016-6-12 8:58:33 org.apache.catalina.session.StandardManager doLoad
严重: ClassNotFoundException while loading persisted sessions: java.lang.ClassNotFoundException: org.springframework.security.core.context.SecurityContextImpl
java.lang.ClassNotFoundException: org.springframework.security.core.context.SecurityContextImpl
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:249)
    at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:74)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1572)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1729)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1326)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
    at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1619)
    at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1084)
    at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:282)
    at org.apache.catalina.session.StandardManager.load(StandardManager.java:202)
    at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:489)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5526)
    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:652)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1948)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)
2016-6-12 8:58:33 org.apache.catalina.session.StandardManager startInternal
严重: Exception loading sessions from persistent storage
java.lang.ClassNotFoundException: org.springframework.security.core.context.SecurityContextImpl
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:249)
    at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:74)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1572)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1729)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1326)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
    at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1619)
    at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1084)
    at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:282)
    at org.apache.catalina.session.StandardManager.load(StandardManager.java:202)
    at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:489)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5526)
    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:652)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1948)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)

用SVN导入项目之后在MyEclipse2013出现了如上的错误,原因是缺少相应的包。

解决:

项目上右键--Properties,如下:

springmvc项目中java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

springmvc项目中java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

点击【add】

springmvc项目中java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

springmvc项目中java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

点击【finish】即可。