Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Tomcat 4.1.24 (or 27) with Log4j 1.2.8 - Tomcat does not start

Mahesh Joshi

2003-09-24


Hi All,

I am migrating my current application to use Struts 1.1 and I am facing a
problem. My current app. has logging implemented with
log4J 1.2.8.

I am facing a bizzare problem when using Log4J 1.2.8 with Tomcat 4.1.24 (or
Tomcat 4.1.27) on Windows 2000 with JDK 1.4.1_02

When I put my log4j -1.2.8 in the jak*/common/lib directory, Tomcat refuses
to start

The exception throw is as follows:

org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging
.LogConfigurationException: No suitable Log constructor
[Ljava.lang.Class;@(protected)
b7 for org.apache.commons.logging.impl.Log4JLogger
    at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:532)
    at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:272)
    at org.apache.commons.logging.LogFactory.getLog (LogFactory.java:414)
    at org.apache.commons.digester.Digester.<init>(Digester.java:346)
    at
org.apache.catalina.startup.Catalina.createStartDigester(Catalina.jav
a:280)
    at org.apache.catalina.startup.Catalina.start (Catalina.java:441)
    at org.apache.catalina.startup.Catalina.execute (Catalina.java:400)
    at org.apache.catalina.startup.Catalina.process (Catalina.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
    at java.lang.reflect.Method.invoke (Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:203)
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable
Log
constructor [Ljava.lang.Class;@(protected)
org.apache.commons.logging.impl.Log4
JLogger
    at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogF
actoryImpl.java:432)
    at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:525)
    ... 12 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(LogF
actoryImpl.java:429)
    ... 13 more

If I put my log4J in the jakarta../shared/lib or WEB-INF/lib, Tomcat does
startup.
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;@(protected)
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;@(protected)
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!

Mahesh


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.