Mantis - Resin
Viewing Issue Advanced Details
4271 minor always 10-26-10 11:02 11-17-10 10:49
closed 4.0.12  
none 4.0.14  
0004271: log4j fails to load custom logger
rep by Nicolai Steven "Resin 4.0.12 classloader issue"

We've noticed that 4.0.12 has a classloader issue.

Enclosed is a sample web app that can be used to recreate the problem.


1. copy the web application (testsess) into resin 4.0.10/webapps.
2. start resin with bin/ console
3. visit <server>/testsess/testLog.jsp
4. Look in the console log, you'll see "....- Should be in the log."
error messages.

Repeat with resin 4.0.12

When you start resin with bin/ console, you'll see the following
in the console:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See [^] for
further details.

These messages do not appear when the same web application is started
with 4.0.10.

When you look at the logs in step 4, the error messages will not be in
the logs (because slf4j was not properly loaded.

We're also seeing intermittant class loading issues elsewhere in our
application, occasionally one of a few classes that are present in the
web application will not load. I don't have a reproducible test case
for this. Hopefully, it is related to this one.
related to 0004275closed ferg ClassNotFoundException: javax.faces.application.ViewHandlerWrapper 

10-29-10 18:20   
I also see the same issue with the Slf4J logging API and Logback but I have no custom loggers (although I am not sure what Nicolai meant on "custom logger"). 4.0.10 works, 4.0.12 does not work with the exact same war.

There is another Slf4J warning on 4.0.10. That is old, it occurred on previous versions too, but maybe there is a relation. It seems that Resin passes a classpath to Slf4J which contain duplicate entries. The warning is the following:
03:00:03,716 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource
[file:/C:/home/mireka-2.1/conf/logback.xml] occurs multipl
e times on the classpath.
03:00:03,716 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource
[file:/C:/home/mireka-2.1/conf/logback.xml] occurs at [fil
... (3 times)

10-30-10 03:58   
I wrote that the issue is with Log4j, that was wrong. I edited my original note, so now it shows SLF4J and Logback.
11-17-10 10:49   
slf4j removed from distribution, since Resin does not depend on it.

The slf4j can be removed from resin/lib as a workaround.