-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Log4JLogger does not implement Log
PostPosted: Wed Jul 28, 2004 6:23 pm 
Newbie

Joined: Wed Jul 28, 2004 6:13 pm
Posts: 12
I'm using Hibernate 2.1.4. I got the quickstart to work successfully under Tomcat 5. I'm now attempting to use Hibernate in an existing web application I have (that runs under Jetty instead of Tomcat). I'm getting the following error when it tries to start the HibernateUtil class (a servlet that loads at startup similar to the quickstart example):

Code:
java.lang.ExceptionInInitializerError
        at com.li.wedge.soap.HibernateUtil.<clinit>(HibernateUtil.java:30)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at java.lang.Class.newInstance0(Class.java:308)
        at java.lang.Class.newInstance(Class.java:261)
        at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:176)
        at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:215)
        at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:445)
        at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:150)
        at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:449)
        at org.mortbay.http.HttpServer.start(HttpServer.java:663)
        at com.li.wedge.modules.AxisModule.run(AxisModule.java:71)
        at java.lang.Thread.run(Thread.java:534)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:246)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
        at net.sf.hibernate.cfg.Configuration.<clinit>(Configuration.java:91)
        ... 15 more
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:416)
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
        ... 19 more
Caused by: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:412)
        ... 20 more


I suspect there is some classloader issue related to Log4J? Has anyone seen this issue. I searched the forums with no luck. Here is a copy of my hibernate.cfg.xml file:

Code:
<hibernate-configuration>

    <session-factory>

        <property name="hibernate.dbcp.driverClassName">com.mysql.jdbc.Driver</property>
        <property name="hibernate.dbcp.username">myuser</property>
        <property name="hibernate.dbcp.password">mypass</property>
        <property name="hibernate.dbcp.url">jdbc:mysql://localhost/wedge</property>

        <property name="show_sql">false</property>
        <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>

        <!-- Mapping files -->
        <mapping resource="users.hbm.xml"/>
        <mapping resource="items.hbm.xml"/>
        <mapping resource="actions.hbm.xml"/>

    </session-factory>

</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 28, 2004 7:05 pm 
Newbie

Joined: Wed Jul 28, 2004 6:13 pm
Posts: 12
I think I answered my own question. My web application uses Axis which has a commons-logger jar file in WEB-INF/lib. I didn't notice that before. I removed it and replaced it with the Apache commons jars shipped with Hibernate and I'm not longer getting the error.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 30, 2004 10:36 am 
Newbie

Joined: Wed Jul 28, 2004 6:13 pm
Posts: 12
OK this problem has cropped up again. I fixed a NoClassDefFound exception for commons-discovery and now I'm getting this log4j error again. I've checked the classpath and there doesnt seem to be any older stale versions of commons-logging.jar anywhere. I'm using the commons-logging-1.0.3 thats shipped with hibernate.

Any ideas?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.