tomcat找不到maven依赖项

时间:2011-11-06 20:48:17

标签: eclipse spring tomcat6 maven-plugin

几个小时前,我正在处理我的网络应用程序,它工作正常。但不知怎的,一个相当奇怪的问题已经开始发生,我收到以下错误:

Nov 7, 2011 1:49:10 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:springatwork' did not find a matching property.
Nov 7, 2011 1:49:10 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\jdk1.6.0_17\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\csvn\bin\;C:\csvn\Python25\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.6.0_17\bin;C:\Home\apache-tomcat\bin;C:\Home\apache-maven-3.0.3\bin;C:\Home\apache-ant\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files\QuickTime\QTSystem\
Nov 7, 2011 1:49:10 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Nov 7, 2011 1:49:10 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 455 ms
Nov 7, 2011 1:49:10 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 7, 2011 1:49:10 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Nov 7, 2011 1:49:11 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:1387)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3877)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    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:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 7, 2011 1:49:11 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Nov 7, 2011 1:49:11 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Nov 7, 2011 1:49:11 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/springatwork] startup failed due to previous errors
Nov 7, 2011 1:49:11 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Nov 7, 2011 1:49:11 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 7, 2011 1:49:11 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31  config=null
Nov 7, 2011 1:49:11 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 328 ms

我正在使用带有eclipse的m2 maven插件,该项目是maven webapp。当我使用 tomcat-maven-plugin 时,该项目正常工作,但如果我尝试将其部署到Eclipse 3.5 IDE中配置的tomcat服务器,则会出现上述错误。

编辑:另外,当我停止tomcat时,我会在最后得到以下内容:

ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [../../../src/share/back/util.c:820]

我唯一记得做的就是尝试使用调试模式进行一些调试。

有人可以帮我理解为什么会这样,以及如何解决这个问题?

感谢。

2 个答案:

答案 0 :(得分:2)

确保在项目属性中有类似的内容 - >部署大会:
[Maven Dependencies :: WEB-INF / lib]

答案 1 :(得分:0)

这可能是一个m2eclipse-wtp错误,它是eclipse插件,它应该导入maven war配置并创建eclipse项目,包括哪些库应该是编译时的,哪些库应该在WEB-中INF / lib目录下。过去不同的版本多年来给我带来了问题。我总是不得不在eclipse项目设置中手动修复它们。不同版本的eclipse将它设置在不同的地方,因此不会让它变得更容易。