log4j: Tomcat 6 出现错误
我使用 Java EE 编写了一个 Web 应用程序。我正在使用 log4j 和 Tomcat 6.0.28。当我在 tomcat 上启动应用程序时,我的控制台每 3 秒就会出现以下错误消息:
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
有人知道这意味着什么吗? log4j.xml 可能有问题吗?如果需要的话,我可以发布更多代码/配置文件。
该应用程序有效,但我有点担心。 谢谢...
I programmed a Web Application with Java EE. I am using log4j and Tomcat 6.0.28. When I am starting my app at tomcat following error message appears every 3 seconds at my console:
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
Has somebody an idea what that means? Is there maybe a problem with log4j.xml? I can post more code/configfiles if nessecary.
The application works, but I am a little bit worried.
Thank you...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是 Tomcat 的 log4j 1.2.15 bug。更新到版本1.2.17或更改为log4j 2,错误消息将消失。
It's a log4j 1.2.15 bug with Tomcat. Update to version 1.2.17 or change to log4j 2 and the error message will be gone.
编辑catalina属性
CATALINA_OPTS=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
edit the catalina properties
CATALINA_OPTS=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
我创建了一个新的 Maven Web 项目,并将所有文件增量迁移到新项目。
之后它就可以正常工作而不会出现 log4j 错误!
I created a new maven webproject and migrated all the files incrementally to the new project.
After that it works without log4j errors!
我有同样的错误。设置系统属性
解决了该症状。
然而,可能存在一个潜在的错误。就我而言,有一个
ClassNotFoundException
。检查你的 tomcat 日志。有关说明,请参阅此错误报告,其中指出它发生在关闭期间,但这似乎是同一个错误。另请尝试此页面。
I had the same error. Setting the system property
solved the symptom.
However, there's probably an underlying error. In my case there was a
ClassNotFoundException
. Check your tomcat logs.For explanations see this bug report, which says it happens during shutdown, but it seems to be the same bug. Also try this page.