调用webservice方法时出现LinkageError

调用webservice方法时出现LinkageError

问题描述:

我有一个 apache servicemix (camel 2.9) 路由,它调用一个 bean,它反过来发出一个 SOAP 请求.SOAP 代码是通过 wsdl2java 生成的并且工作正常(cxf 2.4.0).我遇到的问题是,当抛出 SOAP 错误时,出现以下问题:

I have an apache servicemix (camel 2.9) route which calls a bean, that in turn makes a SOAP request. The SOAP code is generated via wsdl2java and works fine (cxf 2.4.0). The problem i have is when a SOAP fault is thrown, i get the following issue:

Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "javax/xml/soap/SOAPFault"
    at javax.xml.ws.soap.SOAPFaultException.<init>(SOAPFaultException.java:28)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)[175:org.apache.cxf.bundle:2.5.0.fuse-7-061]
    at $Proxy120.catalogProductAttributeMediaRemove(Unknown Source)
    at com.boohoo.magento.MagentoProducts.deleteImageFromProduct(MagentoProducts.java:403)[769:magento-soap-api:1.0.0.SNAPSHOT]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_29]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_29]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_29]
    at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_29]
    at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:340)
    at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:237)
    at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:166)

从一些谷歌搜索(我的背景是 C#)来看,错误似乎表明该类已被多次加载,但我不明白这是怎么可能的,因为 SOAPFaultException 不是我的类之一.

From a bit of googling (my background is C#) the error seems to be stating that the class has been loaded multiple times, but i dont see see how this is possible since SOAPFaultException isnt one of my classes.

有什么想法吗?

干杯.

我发现这是 servicemix 配置的问题.请参阅:http://fusesource.com/forums/thread.jspa?threadID=4016一个>

I found out it was a problem with servicemix config. See: http://fusesource.com/forums/thread.jspa?threadID=4016