在 Tomcat 5.5 中部署 web-app 时如何解决错误listenerStart?
我已将使用 Spring 和 Hibernate 的 Apache Wicket Web 应用程序部署到我的 Tomcat 5.5 实例。当我导航到 Tomcat Manager 界面时,我发现我部署的 Web 应用程序没有运行。当我按“开始”时,我收到以下错误消息; “失败 - 上下文路径 /spaghetti 处的应用程序无法启动”。
我的 catalina.log 包含以下内容:
Apr 15, 2010 1:51:22 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/jsp-api-6.0.16.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/jsp/JspPage.class
Apr 15, 2010 1:51:22 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/servlet-api-6.0.16.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Apr 15, 2010 1:51:24 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Apr 15, 2010 1:51:24 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/spaghetti] startup failed due to previous errors
摘自 web.xml:
<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
非常感谢任何帮助。
I've deployed an Apache Wicket web-application that uses Spring and Hibernate to my Tomcat 5.5 instance. When I navigate to the Tomcat Manager interface I see that the web-application I deployed is not running. When I press 'Start' I get the following error message; "FAIL - Application at context path /spaghetti could not be started".
My catalina.log contains the following:
Apr 15, 2010 1:51:22 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/jsp-api-6.0.16.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/jsp/JspPage.class
Apr 15, 2010 1:51:22 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/servlet-api-6.0.16.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Apr 15, 2010 1:51:24 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Apr 15, 2010 1:51:24 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/spaghetti] startup failed due to previous errors
Excerpt from web.xml:
<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
Any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我发现遵循这些说明有助于找出问题所在。对我来说,那是杀手,不知道什么被打破了。
http:// /mythinkpond.wordpress.com/2011/07/01/tomcat-6-inknown-severe-error-listenerstart-message-how-to-debug-this-error/
从链接引用
I found that following these instructions helped with finding what the problem was. For me, that was the killer, not knowing what was broken.
http://mythinkpond.wordpress.com/2011/07/01/tomcat-6-infamous-severe-error-listenerstart-message-how-to-debug-this-error/
Quoting from the link
您不应在
/WEB-INF/lib
中有任何特定于服务器的库。将它们留在应用程序服务器自己的库中。它只会导致类路径中的冲突。删除/WEB-INF/lib
中的所有特定于应用程序服务器的库(以及JRE/lib
和JRE/lib/ext
如果您已将其中任何一个放置在那里)。将特定于应用程序服务器的库包含在 Web 应用程序的库中的一个常见原因是,初学者认为这是修复不可解析的
javax.servlet
类等编译错误的正确方法。将它们放入 webapp 的库中是错误的解决方案。您应该在编译期间在类路径中引用它们,即 javac -cp /path/to/server/lib/servlet.jar 等,或者如果您使用的是 IDE,则应该集成IDE 中的服务器并将 Web 项目与服务器关联。然后,IDE 将自动在 Web 应用程序项目的类路径 (buildpath) 中获取特定于服务器的库。You should not have any server-specific libraries in the
/WEB-INF/lib
. Leave them in the appserver's own library. It would only lead to collisions in the classpath. Get rid of all appserver-specific libraries in/WEB-INF/lib
(and also inJRE/lib
andJRE/lib/ext
if you have placed any of them there).A common cause that the appserver-specific libraries are included in the webapp's library is that starters think that it is the right way to fix compilation errors of among others the
javax.servlet
classes not being resolveable. Putting them in webapp's library is the wrong solution. You should reference them in the classpath during compilation, i.e.javac -cp /path/to/server/lib/servlet.jar
and so on, or if you're using an IDE, you should integrate the server in the IDE and associate the web project with the server. The IDE will then automatically take server-specific libraries in the classpath (buildpath) of the webapp project.当我编译应用程序的JDK与tomcat JVM不同时,我遇到了这个错误。我验证了 Tomcat 管理器正在运行 jvm 1.6.0,但该应用程序是在 java 1.7.0 下编译的。
升级 Java 并更改启动脚本 (/etc/init.d/tomcat) 中的 JAVA_HOME 后,错误消失了。
I encountered this error when the JDK that I compiled the app under was different from the tomcat JVM. I verified that the Tomcat manager was running jvm 1.6.0 but the app was compiled under java 1.7.0.
After upgrading Java and changing JAVA_HOME in our startup script (/etc/init.d/tomcat) the error went away.
Tom Saleeba 提供的回答非常有帮助。
今天我也遇到了同样的错误
我按照建议添加了logging.properties 文件。以下是我失败的原因:
问题的根本原因是我添加到 web.xml 中的侦听器 (Log4jConfigListener)。根据链接 严重:异常 org.springframework.web.util.Log4jConfigListener< /a> ,无法在未扩展的 WAR 中添加此侦听器。
如果有人知道 OpenShift JBoss 设备上发生了这种情况,可能会有所帮助。
Answered provided by Tom Saleeba is very helpful.
Today I also struggled with the same error
I followed the suggestion and added the logging.properties file. And below was my reason of failure:
The root cause of the issue was a listener (Log4jConfigListener) that I added into the web.xml. And as per the link SEVERE: Exception org.springframework.web.util.Log4jConfigListener , this listener cannot be added within a WAR that is not expanded.
It may be helpful for someone to know that this was happening on OpenShift JBoss gear.