ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Oliver" <oliv...@sourceonenet.com>
Subject RE: axis-java2wsdl LogFactory classloader problem++
Date Fri, 20 May 2005 23:00:09 GMT
More info

>From the Jakarta Commons user list...

This problem is caused when you have *all* of the following true:
 * child-first classloading order selected in child classloader
 * code in child classloader that calls JCL
 * commons-logging.jar available via child classloader
 * code in shared classloader that calls JCL
 * commons-logging.jar available via shared classloader

Because you have code in the shared classloader that calls JCL, you
*must* deploy commons-logging.jar at the shared level.

So the simplest fix is to delete the commons-logging.jar from the child
classloader. The downside of this is that all your logging config then
becomes "global", ie you need to configure logging using a config file
at the shared level, and webapps share the same logging instance. But I
don't think you really care about logging in this case do you?


Regards,

Simon

Ok but within an ant build in eclipse, where do these terms line up?

How do we determine "child-first" classloading in an ant build if we
can?
In an ant build, what is the shared classloader and what is the child
class loader?
Specifically where should commons-logging.jar be and where should it NOT
be?


Michael Oliver
CTO
Alarius Systems LLC
6800 E. Lake Mead Blvd, #1096
Las Vegas, NV 89156
Phone:(702)643-7425
Fax:(702)974-0341
*Note new email changed from oliverm@matrix-media.com

-----Original Message-----
From: Michael Oliver [mailto:oliverm@sourceonenet.com] 
Sent: Friday, May 20, 2005 10:54 AM
To: user@ant.apache.org
Subject: axis-java2wsdl LogFactory classloader problem

I have created an ant task as follows:

 

<path id="compile.classpath">

    <pathelement path ="${webinf.dir}/lib/commons-beanutils.jar"/>

    <pathelement path ="${webinf.dir}/lib/commons-digester.jar"/>

    <pathelement path ="${webinf.dir}/lib/commons-logging.jar"/>

    <pathelement path ="${webinf.dir}/lib/AJContentClient.jar"/>

    <pathelement path ="${webinf.dir}/lib/AJRegistries.jar"/>

    <pathelement path ="${webinf.dir}/lib/AlariusESB.jar"/>

    <pathelement path ="${webinf.dir}/lib/log4j-1.2.8.jar"/>

    <pathelement path ="${webinf.dir}/lib/junit.jar"/>

    <pathelement path ="${webinf.dir}/lib/struts.jar"/>

    <pathelement path = "${webinf.dir}/lib/standard.jar"/>

    <pathelement path ="${webinf.dir}/classes"/>

    <pathelement path ="${classpath.external}"/>

    <pathelement path ="${classpath}"/>

</path>

 

<target name="axis-java2wsdl">

<echo message="Building wsdl for ${project.distname} at
${local.wsdl}}"/>

      

  <axis-java2wsdl 

      classname="com.alarius.assignments.actions.SaveAssignmentForm"

      style= "DOCUMENT"

      namespace= "urn:http://alariussystemsllc.com/AJCCWebService/"

      location= "http://localhost:8080/AlariusAssignments/services/"

      output="AlariusAssignments.wsdl" >

      <classpath>

            <pathelement path ="${webinf.dir}/classes"/>

      </classpath>

      <classpath refid="compile.classpath"/>

                        

  </axis-java2wsdl >

</target>

 

commons-logging and log4j are in the compile.classpath

 

When I run this target I get

 

axis-java2wsdl:

     [echo] Building wsdl for AlariusAssignments at
C:\Java\ArchivedWorkspaces\AlariusAssignments\AlariusAssignments.wsdl}

[axis-java2wsdl] Java2WSDL
com.alarius.assignments.actions.SaveAssignmentForm

[axis-java2wsdl] java.lang.ExceptionInInitializerError

[axis-java2wsdl] at java.lang.Class.forName0(Native Method)

...

[axis-java2wsdl] 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

[axis-java2wsdl] at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImp
l.java:532)...

 

So researching this I find that the "Log4JLogger does not implement Log"
is caused by a classloader problem.

 

So I found in the eclipse ant runtime preferences Global Entries, both
the commons-logging and log4j jars.  So I removed them from there and
ran ant on that target again...

 

axis-java2wsdl:

     [echo] Building wsdl for AlariusAssignments at
C:\Java\ArchivedWorkspaces\AlariusAssignments\AlariusAssignments.wsdl}

[axis-java2wsdl] java.lang.NoClassDefFoundError:
org.apache.commons.logging.LogFactory

[axis-java2wsdl] at
org.apache.axis.components.logger.LogFactory.class$(LogFactory.java:84)

...

 

Huh???

 

If the ant runtime is loading the commons-logging and log4j jars and
that causes a classloader sequence problem, then removing them from
there and leaving the ones in the compile.classpath should NOT cause a
NoClassDefFoundError.

 

How can it be that one way it doesn't find LogFactory and the other way
it has a classloader sequence problem?

 

Conversely if ant needs to load them and the ant axis task also needs to
load them, how do I ensure they are loaded in the proper sequence to
avoid the conflict?

 

Michael Oliver

CTO

Alarius Systems LLC

6800 E. Lake Mead Blvd, #1096

Las Vegas, NV 89156

Phone:(702)643-7425

Fax:(702)974-0341

*Note new email changed from oliverm@matrix-media.com

 

 

 

 



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


Mime
View raw message