Take the 2-minute tour ×

I have a maven war project which depends on an EJB maven project. The EJB project handles all business logic including DB access through Hibernate. Both projects are JEE6 and run on glassfish 3.1.2 using maven. I'm currently trying to configure Log4j to work (also log hibernate) in the scenario described. I have the following log4j.xml file in my ejb's src/main/resources folder (I'm that it is in the classpath):

    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

    <log4j:configuration xmlns:log4j=

        <appender name="consoleAppender"
            <layout class="org.apache.log4j.PatternLayout">
                <param name="ConversionPattern" value="%d

        <logger name="javabeat.net.log4j" additivity="false" >
            <level value="INFO" />
            <appender-ref ref="consoleAppender"/>

I keep getting this error from log4j:

SEVERE: log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not assignable to a "org.apache.log4j.spi.Configurator" variable.

SEVERE: log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by

SEVERE: log4j:ERROR [WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)] whereas object of type

SEVERE: log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)].

SEVERE: log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].

SEVERE: log4j:WARN No appenders could be found for logger (org.hibernate.type.BasicTypeRegistry).

SEVERE: log4j:WARN Please initialize the log4j system properly.


I'm out of ideas thx for the help

share|improve this question
Maybe changing that debug="false" would yield more information? –  madth3 Oct 30 '12 at 0:17
@madth3 no additional info –  Diego Borda Oct 30 '12 at 19:41

1 Answer 1


Hello, the problem that you mentioned it's almost always when you have a webapp that have the log4j.jar in they lib and also in the tomcat lib directory like it's explained in the link that i posted, so you have to choose, where is will be log4j, in all the webapps lib folders or only in the tomcat lib directory :)


Also, you have to avoid to duplicate the commons-logging.jar in a tomcat lib and webapp lib directory.


share|improve this answer

Your Answer


