1

在 tomcat 上部署 Web 应用程序时出现以下错误,请告知我是哪个 jar,在我的类路径中丢失

ct 19, 2012 1:23:20 PM org.apache.catalina.core.StandardContext listenerStart
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:1438)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3743)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
4

1 回答 1

0

仅当您在使用 tomcat 管理的 Eclipse 中运行 Spring Web 应用程序时,才会出现此问题。

请按照以下步骤,

1) Open the project's properties (e.g., right-click on the project's name in the project explorer and select "Properties")
2) select "Deployment Assembly"
3) Click the "Add..." button on the right margin
4) Select "Java Build Path Entries" from the menu of Directive Type and click "Next"
5) Select "Maven Dependencies" from the Java Build Path Entries menu and click "Finish". 

我希望这对你有帮助。

于 2012-10-19T09:05:35.443 回答