axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Sosnoski <>
Subject Re: [Axis2] Classloading broken for static code in message receiver
Date Sun, 18 Mar 2007 20:05:36 GMT
Yes, the jar is in the /lib directory of the aar. And the problem is 
occurring in a static block in the generated message receiver.

 From a look through the code, 
is using the thread's context class loader to load the message receiver. 
I see where the aar class loader is set on the service under 
construction in 
org.apache.axis2.deployment.repository.util.ArchiveReader, but do not 
see it being set as the context class loader. Is that the problem?

  - Dennis

Davanum Srinivas wrote:
> Are these jars inside aar's? We were extracting those jars from the
> aar, dumping them in temp and adding them to classpath. This was
> filling up disk space and turned out to be a bad idea. So i added
> support for jar:// syntax (code from Geronimo) in URLClassLoader using
> a custom URLStreamHandler. I think you could try to generate some
> static blocks in the generated message receiver to do what you need.
> thanks,
> -- dims
> On 3/18/07, Dennis Sosnoski <> wrote:
>> I've started experimenting with the current pre-1.2 code, and ran into a
>> problem with the classloading. JiBX generates static initializers as
>> part of the message receiver code, in order to configure some of the
>> binding information used by JiBX when the service methods are called. In
>> the case I'm working on, one of the classes being loaded by the static
>> code is in a jar file, located in the /lib directory of the aar. This
>> worked fine in 1.1 and 1.1.1, but now I get:
>> java.lang.NoClassDefFoundError:
>> com/sosnoski/ws/library/jibx/AddDuplicateFault
>>     at
>> org.apache.axis2.jibx.library.JibxLibraryMessageReceiverInOut.<clinit>(

>>     ...
>> So it looks like the /lib/*.jar files are no longer being added to the
>> classpath used when loading the message receiver. Is this a deliberate
>> change, and if so can someone explain the logic? Or is there some
>> special classloader I should be using?
>> Thanks,
>>   - Dennis
>> -- 
>> Dennis M. Sosnoski
>> SOA and Web Services in Java
>> Training and Consulting
>> -
>> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message