gpt4 book ai didi

jakarta-ee - Tomcat 错误 - 失败 - 上下文路径/宠物诊所的应用程序无法启动

转载 作者:行者123 更新时间:2023-11-28 22:31:59 24 4
gpt4 key购买 nike

我浏览了类似的问题,但一无所获,所以就这样吧。我安装了 Tomcat 7,然后用 Maven 编译了 PetClinic 应用程序。我成功地将它部署到Tomcat。从那以后,我取消部署并重新编译了 war 文件并部署了它,现在它抛出错误 FAIL - 无法启动位于上下文路径/petclinic 的应用程序。这是日志文件的前几行。请指教。谢谢。

    Sep 23, 2012 2:21:10 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Sep 23, 2012 2:21:10 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/apache/log4j/LogManager$PrivateManager
at org.apache.log4j.LogManager.getLogger(LogManager.java:34)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:209)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
at org.springframework.web.context.ContextCleanupListener.<clinit>(ContextCleanupListener.java:43)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:80)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4831)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5478)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1255)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:714)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:219)

最佳答案

问题出在这里:

SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/apache/log4j/LogManager$PrivateManager
at org.apache.log4j.LogManager.getLogger(LogManager.java:34)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:209)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)

问:您使用的是 log4j(这是我推荐的)还是 slf4j?

建议:

1) 确保相关的 .jar 文件(哎呀 - 为什么不包含 log4j 和 slf4j .jars)在您的 WAR 的 WEB-INF/lib 文件夹中。

2) 确保您的 Tomcat 环境中只有 一个 版本的 log4j(您可能有两个相互冲突的 .jar 版本)。

关于jakarta-ee - Tomcat 错误 - 失败 - 上下文路径/宠物诊所的应用程序无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12556192/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com