geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Łukasz Budnik" <lukasz.bud...@gmail.com>
Subject class loading: LinkageError: loader constraint violation
Date Mon, 15 Dec 2008 19:12:12 GMT
Hi all,

I'm exposing some methods of my SLSB as WebServices (@WebService,
@WebMethod) etc.

All works.

Recently I have added new functionality. I'm invoking external web
services using Axis2: org.apache.axis2.client.ServiceClient.

I added this dependency:

<dependency>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2-kernel</artifactId>
                <version>1.3</version>
                <type>jar</type>
            </dependency>

During deployment of my application (and of course @WebService SLSB)
there is an error.

     [exec]     Error: Operation failed: start of
     [exec]     org.xh.nuntius/EnterpriseContainer/0.2-dev/car failed
     [exec]
     [exec]             Unknown start exception
     [exec]
     [exec]             Configuration
org.xh.nuntius/EnterpriseContainer/0.2-dev/car failed
     [exec]     to start due to the following reasons:
     [exec]
     [exec]       The service
     [exec]
EJBModule=NuntiusEJB.jar,J2EEApplication=org.xh.nuntius/EnterpriseContainer/0.2-dev/car,StatelessSessionBean=ExecutionLoggerImpl,j2eeType=WS
Link,name=ExecutionLoggerImpl
     [exec]     did not start because
     [exec]     org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver cannot be
     [exec]     cast to org.apache.axis2.engine.MessageReceiver

Not good...

Hmmm...

If I remove axis2-kernel dependency, application is deployed - which is weird.

But when execution gets to:

serviceClient.sendReceiveNonBlocking(OMXMLUtils.parseString(payload), callback);

I get:

LinkageError: loader constraint violation: when resolving method
"org.apache.axis2.client.ServiceClient.sendReceiveNonBlocking(Lorg/apache/axiom/om/OMElement;Lorg/apache/axis2/client/async/AxisCallback;)V"
the class loader (instance of
org/apache/geronimo/kernel/classloader/JarFileClassLoader) of the
current class, org/xh/nuntius/enterprise/broker/client/AsynchronousAxis2ServiceClient,
and the class loader (instance of
org/apache/geronimo/kernel/classloader/JarFileClassLoader) for
resolved class, org/apache/axis2/client/ServiceClient, have different
Class objects for the type org/apache/axiom/om/OMElement used in the
signature

I'm 100% confused.

ServiceClient is defined in axis2-kernel. I cannot defined it
explicitly because my @WebService will not be created.

When I skip this dependency Geronimo somehow is adding it when doing
@WebService stuff and there will be 2 different classes for
org/apache/axiom/om/OMElement.

Any ideas? Or maybe I should post this to Geronimo dev?

best regards
Łukasz
Mime
View raw message