tomcat找不到maven依赖
几个小时前,我正在开发我的网络应用程序,它运行良好。但不知怎的,一个相当奇怪的问题开始发生,我收到以下错误:
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]
我记得做的唯一一件事是尝试使用调试模式进行一些调试。
有人可以帮助我理解为什么会发生以及如何解决这个问题吗?
谢谢。
A few hours ago I was working on my web application and it was working alright. But somehow a rather strange problem has started occurring and I am getting the following error:
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
I am using m2 maven plugin with eclipse and the project is maven webapp. The project works alright when I use the tomcat-maven-plugin but if I try to deploy it to the configured tomcat server in my Eclipse 3.5 IDE then I get the above error.
EDIT: Also, when I stop the tomcat I get the following at the end:
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]
Only thing I remember doing was trying to do some debugging using debugging mode.
Could someone help me understand why is it happening and how to solve this problem?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保您的项目属性中有类似的内容 ->部署组件:
[ Maven 依赖项:: WEB-INF/lib ]
Make sure you have something like this in your Project properties -> Deployment Assembly:
[ Maven Dependencies :: WEB-INF/lib ]
这可能是一个 m2eclipse-wtp bug,它是 eclipse 插件,应该导入 maven war 配置并从中创建 eclipse 项目,包括哪些库应该编译时以及哪些库应该位于 WEB-INF/lib 中。过去的不同版本给我带来了多年来的问题。我总是必须在 Eclipse 项目设置中手动修复这些问题。不同版本的 eclipse 将其设置在不同的位置,因此这并不会让事情变得更容易。
This is probably an m2eclipse-wtp bug, which is the eclipse plugin that is supposed to import the maven war configuration and create the eclipse project from, including which libraries should be compile-time and which ones should be in the WEB-INF/lib. Different versions in the past have given me problems for years. I always had to manually fix these in the eclipse project settings. Different versions of eclipse set this in different places, so that doesn't make it any easier.