0

我不确定发生了什么,但我无法使用 eclipse 部署我的项目......它几天前工作了,现在我不断收到同样的错误

任何帮助将不胜感激......这就是我得到的:

SEVERE: 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:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Sep 13, 2013 2:04:06 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Sep 13, 2013 2:04:06 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Sep 13, 2013 2:04:06 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/activate] startup failed due to previous errors
Sep 13, 2013 2:04:06 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
Sep 13, 2013 2:04:07 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Sep 13, 2013 2:04:07 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Sep 13, 2013 2:04:07 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Sep 13, 2013 2:04:07 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Sep 13, 2013 2:04:07 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Sep 13, 2013 2:04:07 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Sep 13, 2013 2:04:07 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Sep 13, 2013 2:04:07 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Sep 13, 2013 2:04:07 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31  config=null
Sep 13, 2013 2:04:07 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 935 ms
4

1 回答 1

0

ContextLoaderListener是 spring-web 的一部分,所以首先这应该在你的 web 项目的“Maven 依赖项”下可见(当然你的 web 项目必须是一个具有 maven 特性的动态 web 项目)。

使用 Eclipse“Kepler”时,我们遇到的问题是,在执行“Maven->Update Project”后,服务器启动的依赖解析丢失了。

通过右键单击 web 项目-> 属性-> 部署程序集进行检查。Maven 依赖项应位于以 WEB-INF/lib 为目标的源列中。否则,您必须使用“Add..->Java Build Path Entries -> Maven Dependencies”添加它。

于 2013-09-14T12:01:34.813 回答