我几个月来一直在研究一个java spring项目。我可以使用maven编译它。我可以将war文件放入tomcat / webapps并运行。
但我不能再从Eclipse中运行该项目了。我曾经能够。我不确定发生了什么,我想我可能已经做了mvn clean,但我无法作为服务器运行。
我正在使用Eclipse Helios,使用maven插件m2e和Maven集成Eclipse WTP 我正在运行Tomcat 6.0.29
这是我在尝试运行as->在服务器上运行时看到的错误:
Apr 4, 2011 10:33:26 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\apps\JAXWS2.2.1-20100617\jaxws-ri\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\apache-maven-2.2.1\bin;C:\Program Files\QuickTime\QTSystem\
Apr 4, 2011 10:33:26 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:my-adapter' did not find a matching property.
Apr 4, 2011 10:33:26 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Apr 4, 2011 10:33:26 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 534 ms
Apr 4, 2011 10:33:26 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 4, 2011 10:33:26 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Apr 4, 2011 10:33:27 AM 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:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4078)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Apr 4, 2011 10:33:27 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Apr 4, 2011 10:33:27 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Apr 4, 2011 10:33:27 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/my-adapter] startup failed due to previous errors
答案 0 :(得分:0)
基于eclipse的tomcat安装无法找到APR库。将APR库路径添加到PATH环境变量应解决此问题。 如果您没有使用APR库,请通过tomcat的server.xml
禁用它们