开发者

log4j:ERROR with Tomcat 6

开发者 https://www.devze.com 2023-01-13 04:43 出处:网络
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:

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.repositorySelect开发者_运维问答or 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...


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.


edit the catalina properties

CATALINA_OPTS=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false


I created a new maven webproject and migrated all the files incrementally to the new project.

After that it works without log4j errors!


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.

For explanations see this bug report, which says it happens during shutdown, but it seems to be the same bug. Also try this page.

0

精彩评论

暂无评论...
验证码 换一张
取 消