我正在使用Jboss-eap-5.1.2部署我的Web服务(SOAP)服务。当我在服务器启动后立即尝试访问它们时,我得到以下异常:
java.lang.LinkageError: loader constraint violation: when resolving overridden method "com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Ljavax/xml/stream/XMLStreamReader;Ljava/lang/Class;)Ljavax/xml/bind/JAXBElement;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, com/sun/xml/bind/v2/runtime/unmarshaller/UnmarshallerImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type javax/xml/stream/XMLStreamReader used in the signature
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.createUnmarshaller(JAXBContextImpl.java:738)
当我尝试访问Web服务之后,我遇到以下异常:
The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.transport.http.client.HttpClientTransport
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:110)
我添加了一个Junit测试用例来查找根本原因。我只能识别出一个区别。
当我尝试从另一个应用程序访问Jboss中部署的Web服务时,客户端使用 JAX-WS RI 2.1.4-b01-
来生成存根。
JAX-WS RI 2.1.4-b01-: Stub for http://10.XX.XXX.16/awdServer/WorkFlowService
当我尝试从JUNIT测试用例访问相同的Web服务时,客户端使用了 JAX-WS RI 2.1.6 in JDK 6
。
JAX-WS RI 2.1.6 in JDK 6: Stub for http://10.XX.XXX.16/awdServer/WorkFlowService
任何人都知道为什么会这样发生?