Adam,  I tried about everything ... I finally downloaded the latest nightly build of commons-logging.jar and it fixed the problem.  I still have other problems, but at least logging code is not throwing exceptions on me!
 
Thanks for your reply!
 
Mike
----- Original Message -----
From: ajack
Sent: Thursday, March 21, 2002 5:18 PM
Subject: RE: ClassCastException in commons logging

I messed around w/ this problem for a few hours, and since it was so painful I can't recall 100% exactly what fixed it. It might be that log4j wasn't loaded for that app [class not found caught & null returned, null giving class cast...], or that a log4j was not configured right [odd, I thought it failed safe, but seems true], or that you needed commons-logging.properties with org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory or that a bad commons-logging.jar was shipped in the webapp/WEB-INF/lib directory. My guess would be one of the former, but I pretty much tried all.
 
Why it happens in one direction I do not know, if it is one server [not two] but I've seen some folk here talk about TC classloader issues that go over my head. If two --- environment.
 
regards
 
Adam
-----Original Message-----
From: Mike Brown [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 3:42 PM
To: [EMAIL PROTECTED]
Subject: ClassCastException in commons logging

I have two applications that are running under tomcat that communicate using methods exposed as axis web services.
The service method is identical for each service and looks like:
 
public void processMessage(String message)
 
Thus when A wants to communicate with B it invokes B's processMessage service method with a parameter that happens to be an XML formatted string.
 
This all works good except for one condition ... when A calls B's processMessage method and in that method B calls A's processMessage method, I get the following exception:
 
java.lang.ClassCastException: org.apache.commons.logging.impl.LogFactoryImpl
        at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:504)
        at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:350)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:400)
        at org.apache.axis.message.MessageElement.<clinit>(Unknown Source)
        at org.apache.axis.client.Call.invoke(Unknown Source)
        at org.apache.axis.client.Call.invoke(Unknown Source)
        at org.apache.axis.client.Call.invokeOneWay(Unknown Source)
 
Any ideas???
 
Mike

Reply via email to