Sven
Sven

Reputation: 6338

log4j:ERROR with Tomcat 6

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...

Upvotes: 7

Views: 10947

Answers (4)

user1075613
user1075613

Reputation: 754

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.

Upvotes: -1

Ibo
Ibo

Reputation: 89

edit the catalina properties

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

Upvotes: 1

Federico Pugnali
Federico Pugnali

Reputation: 655

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.

Upvotes: 5

Sven
Sven

Reputation: 6338

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

After that it works without log4j errors!

Upvotes: 0

Related Questions