You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Per Kreipke <pe...@onclave.com> on 2002/09/25 22:09:11 UTC

Using Axis SOAP client from Tomcat/Catalina causes LogConfigurationException...

I'm using Axis RC1 and Tomcat 4.0.4.

I'm trying to use some SOAP client classes built with WSDL2Java from within
classes running in Tomcat's server context (e.g. classes that live in
.../jakarta-tomcat-4.0.4/server/classes).

Tomcat starts fine but when the SOAP call is made, I get the following
exception:

org.apache.commons.logging.LogConfigurationException:
  Class org.apache.commons.logging.impl.Log4JCategoryLog does not implement
Log

A partial stack trace from my WSDL generated Java is at the bottom of this
email. My guess is that the log returned is null and therefor doesn't cast.
But I'm surprised I don't get an NPE instead, so who knows.

Note:

- when I run tests from the command line, using a classpath which points to
the axis rc1 'lib' directory, everything is fine.

- tomcat/server/classes contains my .class files

- tomcat/common/lib contains _all_ the axis rc1 jars from 'lib'


I've tried:

- using commons-logging.jar version 1.0.1 instead of the 1.1-dev version
included in AxisRC1. No go.

- dropping a log4j.properties file in [tomcat]/server/classes. No go.

- copied axis.jar (which contains its own log4j.properties) into
[tomcat]/server/lib. No go.

- copied _all_ the Axis jars into [tomcat]/server/lib. No go.


I'm at a loss to explain why it doesn't work. Suggestions?

Per


2002-09-25 15:44:24 HttpProcessor[8080][4] process.invoke
java.lang.ExceptionInInitializerError:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Class
org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log
	at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:551)
	at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.ja
va:287)
	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
	at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:77)
	at
org.apache.axis.configuration.EngineConfigurationFactoryFinder.<clinit>(Engi
neConfigurationFactoryFinder.java:87)
	at org.apache.axis.client.Service.<init>(Service.java:110)
	at CAYENNE.OcwebserviceLocator.<init>(OcwebserviceLocator.java:10)


RE: Using Axis SOAP client from Tomcat/Catalina causes LogConfigurationException...

Posted by Per Kreipke <pe...@onclave.com>.
> No..  :-)

Well, thanks for not answering :-)

> It's not clear to me exactly WHAT your exact problem is... but can I
> hazard a guess that you have your application classloaders configured to
> load the webapp classes before the appserver host classes?

Not on purpose. Tomcat default perhaps.

> IF that is true, then the following occurs [and the ramifications of this
> problem extend well beyond commons-logging, it is my opinion that we are
> only seeing the tip of this iceburg :-]

Yes, I've seen other people not the same thing on Cocoon and Tomcat lists.

> First, some nomenclature:
>
> - let <classLoader>:: be a classloader
> - let <classLoader>::<Class> be a <Class> loaded by <classLoader>.
>
> Note that <classLoaderA>::<YourClass> is NOT the same class as
> <classLoaderB>::<YourClass>  [the same class resource loaded by two
> different classloaders does NOT result in equivalent classes within the
> JVM].
>
> - let a.jar & b.jar both be in an appserver/lib directory (used
> internally
> & exposed to applications).
> - A class A defined in a.jar.
> - A class B, such that B extends on A, defined in b.jar
> - A property file, system property, or service definition defines B as "a
> desired" implementation of A.
> - During host startup, appserver::A and appserver::B are loaded (by
> whatever means).
>
> Now, drop a copy of a.jar into a webapp (classloader hierarchy:
> webapp/lib
> --(isChildOf)--> appserver/lib).
> In a first case, webapp::A is never seen: the class loaders
> typically find
> appserver::A first.
> However, Tomcat (and others) often allow a flag to be set to allow local
> classes to be loaded before appserver classes.
>
> Remember our property file/system property defining B as "the desired"
> implementation of A?
>
> If the system now attempts to locate & load B, without being aware of
> which classloader actually found it (A is unaware of whether webapp:: or
> appserver:: finds the resource), then in this case it will find & load
> appserver::B.
>
> The class loaded (appserver::B) does NOT extend webapp::A, instead it
> extends a different class: appserver::A.

Quite.

All that said, I'm glad I have something working, and shouldn't have asked
the follow up in the first place.

Per


RE: Using Axis SOAP client from Tomcat/Catalina causes LogConfigurationException...

Posted by Richard Sitze <rs...@us.ibm.com>.
No..  :-)

It's not clear to me exactly WHAT your exact problem is... but can I 
hazard a guess that you have your application classloaders configured to 
load the webapp classes before the appserver host classes?

IF that is true, then the following occurs [and the ramifications of this 
problem extend well beyond commons-logging, it is my opinion that we are 
only seeing the tip of this iceburg :-]

First, some nomenclature:

- let <classLoader>:: be a classloader
- let <classLoader>::<Class> be a <Class> loaded by <classLoader>.

Note that <classLoaderA>::<YourClass> is NOT the same class as 
<classLoaderB>::<YourClass>  [the same class resource loaded by two 
different classloaders does NOT result in equivalent classes within the 
JVM].

- let a.jar & b.jar both be in an appserver/lib directory (used internally 
& exposed to applications).
- A class A defined in a.jar.
- A class B, such that B extends on A, defined in b.jar
- A property file, system property, or service definition defines B as "a 
desired" implementation of A.
- During host startup, appserver::A and appserver::B are loaded (by 
whatever means).

Now, drop a copy of a.jar into a webapp (classloader hierarchy: webapp/lib 
--(isChildOf)--> appserver/lib).
In a first case, webapp::A is never seen: the class loaders typically find 
appserver::A first.
However, Tomcat (and others) often allow a flag to be set to allow local 
classes to be loaded before appserver classes.

Remember our property file/system property defining B as "the desired" 
implementation of A?

If the system now attempts to locate & load B, without being aware of 
which classloader actually found it (A is unaware of whether webapp:: or 
appserver:: finds the resource), then in this case it will find & load 
appserver::B.

The class loaded (appserver::B) does NOT extend webapp::A, instead it 
extends a different class: appserver::A.

<ras>

*******************************************
Richard A. Sitze
IBM WebSphere WebServices Development




"Per Kreipke" <pe...@onclave.com>
09/25/2002 03:45 PM
Please respond to axis-dev
 
        To:     <ax...@xml.apache.org>
        cc: 
        Subject:        RE: Using Axis SOAP client from Tomcat/Catalina 
causes LogConfigurationException...

 


> Isn't Tomcat just picking up its commons-logging.jar from
> tomcat/server/lib?  You might have to see whether Tomcat is stable if
> you replace that with the one from Axis rc1.

Scott,

Thanks for the suggestion. You're right, the one in [tomcat]/server/lib
should be used by the 'kernel'.

I'd tried all of these:

    [tomcat]/common/lib         [tomcat]/server/lib

1)  commons-logging 1.0.1-dev   -none-
2)  commons-logging 1.1-dev     -none-

3)  commons-logging 1.0.1-dev   commons-logging 1.0.1-dev
4)  commons-logging 1.1-dev     commons-logging 1.0.1-dev

5)  commons-logging 1.0.1-dev   commons-logging 1.1-dev
6)  commons-logging 1.1-dev     commons-logging 1.1-dev

All caused the same error.

The trick turned out to be Richard's note about having a commons-logging 
in
your WARs/EARs as well.

When I removed the one in the Cocoon WAR and went back to the ones that
Tomcat and Axis wanted, it worked.

E.g. this worked
    [tomcat]/common/lib         [tomcat]/server/lib

4)  commons-logging 1.1-dev     commons-logging 1.0.1-dev

Richard,

Care to comment about what the problem is? I'm a little unclear.

Per




RE: Using Axis SOAP client from Tomcat/Catalina causes LogConfigurationException...

Posted by Per Kreipke <pe...@onclave.com>.
> Isn't Tomcat just picking up its commons-logging.jar from
> tomcat/server/lib?  You might have to see whether Tomcat is stable if
> you replace that with the one from Axis rc1.

Scott,

Thanks for the suggestion. You're right, the one in [tomcat]/server/lib
should be used by the 'kernel'.

I'd tried all of these:

    [tomcat]/common/lib         [tomcat]/server/lib

1)  commons-logging 1.0.1-dev   -none-
2)  commons-logging 1.1-dev     -none-

3)  commons-logging 1.0.1-dev   commons-logging 1.0.1-dev
4)  commons-logging 1.1-dev     commons-logging 1.0.1-dev

5)  commons-logging 1.0.1-dev   commons-logging 1.1-dev
6)  commons-logging 1.1-dev     commons-logging 1.1-dev

All caused the same error.

The trick turned out to be Richard's note about having a commons-logging in
your WARs/EARs as well.

When I removed the one in the Cocoon WAR and went back to the ones that
Tomcat and Axis wanted, it worked.

E.g. this worked
    [tomcat]/common/lib         [tomcat]/server/lib

4)  commons-logging 1.1-dev     commons-logging 1.0.1-dev

Richard,

Care to comment about what the problem is? I'm a little unclear.

Per


Re: Using Axis SOAP client from Tomcat/Catalina causes LogConfigurationException...

Posted by Scott Nichol <sn...@scottnichol.com>.
Isn't Tomcat just picking up its commons-logging.jar from
tomcat/server/lib?  You might have to see whether Tomcat is stable if
you replace that with the one from Axis rc1.

Scott Nichol

----- Original Message -----
From: "Per Kreipke" <pe...@onclave.com>
To: <ax...@xml.apache.org>
Sent: Wednesday, September 25, 2002 4:09 PM
Subject: Using Axis SOAP client from Tomcat/Catalina causes
LogConfigurationException...


> I'm using Axis RC1 and Tomcat 4.0.4.
>
> I'm trying to use some SOAP client classes built with WSDL2Java from
within
> classes running in Tomcat's server context (e.g. classes that live in
> .../jakarta-tomcat-4.0.4/server/classes).
>
> Tomcat starts fine but when the SOAP call is made, I get the following
> exception:
>
> org.apache.commons.logging.LogConfigurationException:
>   Class org.apache.commons.logging.impl.Log4JCategoryLog does not
implement
> Log
>
> A partial stack trace from my WSDL generated Java is at the bottom of
this
> email. My guess is that the log returned is null and therefor doesn't
cast.
> But I'm surprised I don't get an NPE instead, so who knows.
>
> Note:
>
> - when I run tests from the command line, using a classpath which
points to
> the axis rc1 'lib' directory, everything is fine.
>
> - tomcat/server/classes contains my .class files
>
> - tomcat/common/lib contains _all_ the axis rc1 jars from 'lib'
>
>
> I've tried:
>
> - using commons-logging.jar version 1.0.1 instead of the 1.1-dev
version
> included in AxisRC1. No go.
>
> - dropping a log4j.properties file in [tomcat]/server/classes. No go.
>
> - copied axis.jar (which contains its own log4j.properties) into
> [tomcat]/server/lib. No go.
>
> - copied _all_ the Axis jars into [tomcat]/server/lib. No go.
>
>
> I'm at a loss to explain why it doesn't work. Suggestions?
>
> Per
>
>
> 2002-09-25 15:44:24 HttpProcessor[8080][4] process.invoke
> java.lang.ExceptionInInitializerError:
> org.apache.commons.logging.LogConfigurationException:
> org.apache.commons.logging.LogConfigurationException:
> org.apache.commons.logging.LogConfigurationException: Class
> org.apache.commons.logging.impl.Log4JCategoryLog does not implement
Log
> at
>
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImp
l.ja
> va:551)
> at
>
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp
l.ja
> va:287)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
> at
org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:77)
> at
>
org.apache.axis.configuration.EngineConfigurationFactoryFinder.<clinit>(
Engi
> neConfigurationFactoryFinder.java:87)
> at org.apache.axis.client.Service.<init>(Service.java:110)
> at CAYENNE.OcwebserviceLocator.<init>(OcwebserviceLocator.java:10)
>
>


RE: Using Axis SOAP client from Tomcat/Catalina causes LogConfigurationException...

Posted by Per Kreipke <pe...@onclave.com>.
Richard,

> where did you drop commons-logging.jar OR commons-logging-api.jar (one,
> but NOT both please).  This can happen if you have
> commons-logging in BOTH
> your host library and your EAR/WAR file(s).

[aside: this only occurs if I make SOAP calls from the tomcat 'kernel'. SOAP
calls from webapps work fine]

I have had commons-logging.jar in [tomcat]/common/lib and in my Cocoon
web-inf/lib (e.g. came with WAR file).

I will try to remove the one in my webapp and see.

Per


Re: Using Axis SOAP client from Tomcat/Catalina causes LogConfigurationException...

Posted by Richard Sitze <rs...@us.ibm.com>.
Per,

where did you drop commons-logging.jar OR commons-logging-api.jar (one, 
but NOT both please).  This can happen if you have commons-logging in BOTH 
your host library and your EAR/WAR file(s).

<ras>

*******************************************
Richard A. Sitze
IBM WebSphere WebServices Development




"Per Kreipke" <pe...@onclave.com>
09/25/2002 03:09 PM
Please respond to axis-dev
 
        To:     <ax...@xml.apache.org>
        cc: 
        Subject:        Using Axis SOAP client from Tomcat/Catalina causes 
LogConfigurationException...

 


I'm using Axis RC1 and Tomcat 4.0.4.

I'm trying to use some SOAP client classes built with WSDL2Java from 
within
classes running in Tomcat's server context (e.g. classes that live in
.../jakarta-tomcat-4.0.4/server/classes).

Tomcat starts fine but when the SOAP call is made, I get the following
exception:

org.apache.commons.logging.LogConfigurationException:
  Class org.apache.commons.logging.impl.Log4JCategoryLog does not 
implement
Log

A partial stack trace from my WSDL generated Java is at the bottom of this
email. My guess is that the log returned is null and therefor doesn't 
cast.
But I'm surprised I don't get an NPE instead, so who knows.

Note:

- when I run tests from the command line, using a classpath which points 
to
the axis rc1 'lib' directory, everything is fine.

- tomcat/server/classes contains my .class files

- tomcat/common/lib contains _all_ the axis rc1 jars from 'lib'


I've tried:

- using commons-logging.jar version 1.0.1 instead of the 1.1-dev version
included in AxisRC1. No go.

- dropping a log4j.properties file in [tomcat]/server/classes. No go.

- copied axis.jar (which contains its own log4j.properties) into
[tomcat]/server/lib. No go.

- copied _all_ the Axis jars into [tomcat]/server/lib. No go.


I'm at a loss to explain why it doesn't work. Suggestions?

Per


2002-09-25 15:44:24 HttpProcessor[8080][4] process.invoke
java.lang.ExceptionInInitializerError:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Class
org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log
                 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:551)
                 at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.ja
va:287)
                 at 
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
                 at 
org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:77)
                 at
org.apache.axis.configuration.EngineConfigurationFactoryFinder.<clinit>(Engi
neConfigurationFactoryFinder.java:87)
                 at 
org.apache.axis.client.Service.<init>(Service.java:110)
                 at 
CAYENNE.OcwebserviceLocator.<init>(OcwebserviceLocator.java:10)




RE: Using Axis SOAP client from Tomcat/Catalina causes LogConfigurationException...

Posted by Per Kreipke <pe...@onclave.com>.

> -----Original Message-----
> From: Per Kreipke [mailto:per@onclave.com]
> Sent: Wednesday, September 25, 2002 4:09 PM
> To: axis-dev@xml.apache.org
> Subject: Using Axis SOAP client from Tomcat/Catalina causes
> LogConfigurationException...
>
>
> I'm using Axis RC1 and Tomcat 4.0.4.
>
> I'm trying to use some SOAP client classes built with WSDL2Java
> from within
> classes running in Tomcat's server context (e.g. classes that live in
> .../jakarta-tomcat-4.0.4/server/classes).
>
> Tomcat starts fine but when the SOAP call is made, I get the following
> exception:
>
Just tried:

- setting the 'log4j.configuration' property to point to an absolute
log4j.properties file. No go.

Suggestions would be much appreciated.

Per