在 Tomcat 5.5 中部署 web-app 时如何解决错误listenerStart?

发布于 2024-08-29 02:45:36 字数 1271 浏览 8 评论 0原文

我已将使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

又怨 2024-09-05 02:45:36

我发现遵循这些说明有助于找出问题所在。对我来说,那是杀手,不知道什么被打破了。

http:// /mythinkpond.wordpress.com/2011/07/01/tomcat-6-inknown-severe-error-listenerstart-message-how-to-debug-this-error/

从链接引用

在 Tomcat 6 或更高版本中,默认记录器是“java.util.logging”记录器,而不是 Log4J。因此,如果您尝试添加“log4j.properties”文件 - 这将不起作用。 Java utils 记录器查找名为“logging.properties”的文件,如下所示:
http://tomcat.apache.org/tomcat-6.0-doc/logging.html< /p>

因此,要获取调试详细信息,请在 WAR 的“/WEB-INF/classes”文件夹下创建一个“logging.properties”文件,然后就完成了。

现在,当您重新启动 Tomcat 时,您将看到所有调试的全部内容!!!

示例logging.properties文件:

org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler

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

In Tomcat 6 or above, the default logger is the”java.util.logging” logger and not Log4J. So if you are trying to add a “log4j.properties” file – this will NOT work. The Java utils logger looks for a file called “logging.properties” as stated here:
http://tomcat.apache.org/tomcat-6.0-doc/logging.html

So to get to the debugging details create a “logging.properties” file under your”/WEB-INF/classes” folder of your WAR and you’re all set.

And now when you restart your Tomcat, you will see all of your debugging in it’s full glory!!!

Sample logging.properties file:

org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler
思念满溢 2024-09-05 02:45:36
/var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/jsp-api-6.0.16.jar
/var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/servlet-api-6.0.16.jar

您不应在 /WEB-INF/lib有任何特定于服务器的库。将它们留在应用程序服务器自己的库中。它只会导致类路径中的冲突。删除 /WEB-INF/lib 中的所有特定于应用程序服务器的库(以及 JRE/libJRE/lib/ext 如果您已将其中任何一个放置在那里)。

将特定于应用程序服务器的库包含在 Web 应用程序的库中的一个常见原因是,初学者认为这是修复不可解析的 javax.servlet 类等编译错误的正确方法。将它们放入 webapp 的库中是错误的解决方案。您应该在编译期间在类路径中引用它们,即 javac -cp /path/to/server/lib/servlet.jar 等,或者如果您使用的是 IDE,则应该集成IDE 中的服务器并将 Web 项目与服务器关联。然后,IDE 将自动在 Web 应用程序项目的类路径 (buildpath) 中获取特定于服务器的库。

/var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/jsp-api-6.0.16.jar
/var/lib/tomcat5.5/webapps/spaghetti/WEB-INF/lib/servlet-api-6.0.16.jar

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 in JRE/lib and JRE/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.

£烟消云散 2024-09-05 02:45:36

当我编译应用程序的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.

围归者 2024-09-05 02:45:36

Tom Saleeba 提供的回答非常有帮助。
今天我也遇到了同样的错误

2015 年 4 月 28 日下午 7:53:27 org.apache.catalina.core.StandardContext startInternal
严重:监听器启动错误

我按照建议添加了logging.properties 文件。以下是我失败的原因:

java.lang.IllegalStateException:无法设置 Web 应用程序根系统
WAR 文件未展开时的属性

问题的根本原因是我添加到 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

Apr 28, 2015 7:53:27 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart

I followed the suggestion and added the logging.properties file. And below was my reason of failure:

java.lang.IllegalStateException: Cannot set web app root system
property when WAR file is not expanded

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文