log4j:ERROR A org.apache.log4j (FileAppender) object is not assignable to a org.apache.log4j (Appender) variable

When deploying an ear file including log4j.jar into Glassfish3.x, following Exception is thrown:

Add log4j.jar to Glassfish lib, e.g. /domains/mydomain/lib/ext or /glassfish/lib and remove it from ear.

Additional information:
This problem is due to some classloader issues, which typically result from having two copies of log4j.jar within your ear, e.g. one in ear/lib/ and another one in /ear/war/META-INF/lib.

This can also happen, if you have only one single copy of log4j.jar within your ear, in this case it seems to be a Glassfish specific classloader problem.

Share itTweet about this on TwitterEmail this to someoneShare on FacebookShare on Google+

Leave a Reply

Your email address will not be published. Required fields are marked *