java log4j:Tomcat 6 的错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3547104/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
log4j:ERROR with Tomcat 6
提问by Sven
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:
我使用 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.
Has somebody an idea what that means? Is there maybe a problem with log4j.xml? I can post more code/configfiles if nessecary.
有人知道这意味着什么吗?log4j.xml 可能有问题吗?如果需要,我可以发布更多代码/配置文件。
The application works, but I am a little bit worried. Thank you...
该应用程序有效,但我有点担心。谢谢...
采纳答案by Sven
I created a new maven webproject and migrated all the files incrementally to the new project.
我创建了一个新的 maven webproject 并将所有文件增量迁移到新项目。
After that it works without log4j errors!
之后它就可以正常工作了,没有 log4j 错误!
回答by Federico Pugnali
回答by Ibo
edit the catalina properties
编辑 catalina 属性
CATALINA_OPTS=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
CATALINA_OPTS=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
回答by user1075613
I had the same error. Setting the system property
我有同样的错误。设置系统属性
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
solved the symptom.
解决了症状。
However, there's probably an underlying error. In my case there was a ClassNotFoundException. Check your tomcat logs.
但是,可能存在潜在错误。就我而言,有一个ClassNotFoundException. 检查您的 tomcat 日志。
For explanations see this bug report, which says it happens during shutdown, but it seems to be the same bug. Also try this page.

