vendredi 31 juillet 2015

Changing JAX-WS RI of Jboss server to use JAX-WS RI 2.1.6 in JDK 6

I am using Jboss-eap-5.1.2 where my web services(SOAP) services are deployed. When I try access them immediately after the server started, I am getting the following exception:

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)

When I try to access the web services after that, I am getting the following exception:

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)

I have added a Junit test case to find the root cause. Only one difference I could identify.

JAX-WS RI 2.1.4-b01- is used by the client to generate the stub when I try to access the web services deployed in Jboss from another application.

JAX-WS RI 2.1.4-b01-: Stub for http://ift.tt/1UbpK7R

JAX-WS RI 2.1.6 in JDK 6 is been used by the client when I try to access the same web services from JUNIT test case.

JAX-WS RI 2.1.6 in JDK 6: Stub for http://ift.tt/1UbpK7R

Anybody has any idea on why it is happening like that?

Aucun commentaire:

Enregistrer un commentaire