logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Tomcat 4.1.24 and log4j -1.2.8.jar
Date Wed, 24 Sep 2003 16:29:09 GMT

Tomcat uses commons-logging as well.  Try doing this.  Put a copy of 
log4j.jar in CATALINA_HOME/common/lib.  Also put a copy of log4j.jar in 
WEB-INF/lib of your webapp.  commons-logging uses some class loader 
trickery that flubs up much of the time.  I don't even want to know why it 
does this, I just want it to go away.  But since that isn't going to happen 
any time soon, we'll try to satisfy its quirks.

Oh, and you might want to put a copy of log4j.xml in 
CATALINA_HOME/common/classes with a root logger set to the level "warn" and 
a console appender.  That way, you won't get messages in Tomcat's logs 
saying that log4j failed to find its configuration.

Jake

At 07:40 AM 9/24/2003 -0700, you wrote:
>Hi,
>
>When I do that, struts 1.1 does not initialize with the following exception
>mentioned in my earlier post:
>
>However, Struts fails to initialize giving  an exception as follows:
>javax.servlet.ServletException: Error instantiating servlet class
>org.apache.struts.action.ActionServlet
>  at
>org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
>2)
>...
>----- Root Cause -----
>java.lang.ExceptionInInitializerError
>Caused by: org.apache.commons.logging.LogConfigurationException:
>org.apache.commons.logging.LogConfigurationException: No suitable Log
>constructor [Ljava.lang.Class;@3a5794 for
>org.apache.commons.logging.impl.Log4JLogger
>  at
>org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
>va:532)
>Caused by: org.apache.commons.logging.LogConfigurationException: No suitable
>Log constructor [Ljava.lang.Class;@3a5794 for
>org.apache.commons.logging.impl.Log4JLogger
>  at
>org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
>mpl.java:432)
>  at
>org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
>va:525)
>  ... 28 more
>Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
>  at java.lang.Class.getDeclaredConstructors0(Native Method)
>  at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
>  at java.lang.Class.getConstructor0(Class.java:1762)
>  at java.lang.Class.getConstructor(Class.java:1002)
>  at
>org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
>mpl.java:429)
>  ... 29 more
>
>
>What am I missing?
>
>Thanks!
>
>----- Original Message -----
>From: "Shapira, Yoav" <Yoav.Shapira@mpi.com>
>To: "Log4J Users List" <log4j-user@jakarta.apache.org>
>Sent: Wednesday, September 24, 2003 5:44 AM
>Subject: RE: Tomcat 4.1.24 and log4j -1.2.8.jar
>
>
>
>Howdy,
>
> >When I put my log4j -1.2.8 in the jak*/common/lib directory, Tomcat
>refuses
> >to start
>
>Not the right place.  Put it in the WEB-INF/lib directory of your
>webapp.
>
>Yoav Shapira
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential, proprietary
>and/or privileged.  This e-mail is intended only for the individual(s) to
>whom it is addressed, and may not be saved, copied, printed, disclosed or
>used by anyone else.  If you are not the(an) intended recipient, please
>immediately delete this e-mail from your computer system and notify the
>sender.  Thank you.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message