java.lang.LinkageError using camel-cxf in FUSE 4.3
fvbetteraey Aug 30, 2010 10:40 AMHello,
I try to define a camel route from a camel-cxf consumer endpoint to a file. Sending a message to the camel-cxf endpoint results in the error message:
java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.apache.cxf.jaxb.attachment.JAXBAttachmentUnmarshaller.getAttachmentAsDataHandler(Ljava/lang/String;)Ljavax/activation/DataHandler;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, org/apache/cxf/jaxb/attachment/JAXBAttachmentUnmarshaller, and its superclass loader (instance of <bootloader>), have different Class objects for the type javax/activation/DataHandler used in the signature
The error can be reproduced by trying to run the 'cxf-camel-nrm' example in a 'fresh' FUSE ESB 4.3 installation:
karaf@root> features:install examples-cxf-camel-nmr karaf@root> >>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:sayHi xmlns:ns1=" http://cxfcamel.examples.servicemix.apache.org/"><arg0>Guillaume</arg0></ns1:sayHi></soap:Body></soap:Envelope> Exception in thread "pool-nmr.endpoint.HelloWorld-thread-1" java.lang.LinkageError: loader constraint violation: when re solving overridden method "org.apache.cxf.jaxb.attachment.JAXBAttachmentUnmarshaller.getAttachmentAsDataHandler(Ljava/la ng/String;)Ljavax/activation/DataHandler;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultCl assLoader) of the current class, org/apache/cxf/jaxb/attachment/JAXBAttachmentUnmarshaller, and its superclass loader (i nstance of <bootloader>), have different Class objects for the type javax/activation/DataHandler used in the signature at org.apache.cxf.jaxb.JAXBDataBase.getAttachmentUnmarshaller(JAXBDataBase.java:78) at org.apache.cxf.jaxb.io.DataReaderImpl.createUnmarshaller(DataReaderImpl.java:92) at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:128) at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:109) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110) at org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:147) at org.apache.servicemix.nmr.core.InternalEndpointWrapper.process(InternalEndpointWrapper.java:86) at org.apache.servicemix.nmr.core.ChannelImpl.process(ChannelImpl.java:255) at org.apache.servicemix.nmr.core.ChannelImpl$1.run(ChannelImpl.java:215) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
I do not know how to avoid this error and would be thankful for any help.
Regards
Franz