1

We are trying to access SOAP 1.1 Web services from a Java JAX-RS adapter.

We are using a SOAP Client that has been generated from our WSDL.

But when unmarshalling soap fault we get the following exception:

...
Caused by: java.lang.ExceptionInInitializerError
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:107)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)
    at com.sun.proxy.$Proxy196.rechercherContrats(Unknown Source)
    at fr.sma.prod.adapter.ContratResource.rechercherContrats(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)
...
Caused by: java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to com.sun.xml.internal.bind.api.JAXBRIContext
    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder$1.run(SOAPFaultBuilder.java:570)
    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder$1.run(SOAPFaultBuilder.java:566)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createJAXBContext(SOAPFaultBuilder.java:565)
    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.<clinit>(SOAPFaultBuilder.java:555)
... 94 more

Versions:

********************************************************************************
product = WebSphere Application Server 8.5.5.5 (wlp-1.0.8.cl50520150305-2202)
wlp.install.dir = C:/Users/a10344/.ibm/mobilefirst/7.1.0.00.20150807-0630/server/wlp/
java.home = C:\Program Files\Java\jdk1.7.0_71\jre
java.version = 1.7.0_71
java.runtime = Java(TM) SE Runtime Environment (1.7.0_71-b14)
os = Windows 7 (6.1; amd64) (en_US)
process = 52164@P72302W
********************************************************************************

The jaxb classes for the service are generated with a CXF maven plugin that generates a standard jax-ws/jaxb code.

...
service= javax.xml.ws.Service.create(wsdlUrl,serviceQName);
productionService= service.getPort(ProductionService.class);
productionService.rechercherContrat(...);
...

Thanks,

Milan

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
mdsma
  • 41
  • 5
  • Can you provide the Java implementation? – Idan Adar Sep 26 '15 at 07:15
  • Hi Idan, I've modified my question adding more information on our java code. – mdsma Sep 29 '15 at 08:52
  • In order to help I will need to know which Jars did you put in the adapter's lib folder – Yotam Madem Sep 29 '15 at 21:48
  • BTW, check if http://stackoverflow.com/questions/17114090/java-lang-classcastexception-com-sun-xml-bind-v2-runtime-jaxbcontextimpl-cannot helps – Yotam Madem Sep 29 '15 at 21:49
  • @Idan I have 1 simple jar (no dependences, no xml stuf, juste one URLConnection call), to obtain the url of the wsdl. – mdsma Sep 30 '15 at 09:00
  • @MilanSMA, we will need a reproduction. Can you provide an MFPF project with the adapter ready-to-test? – Idan Adar Sep 30 '15 at 09:01
  • @Madem your link is prety similar but it doesn't resolve our problem, I think the conflict could be between jaxb libraries packaged in worklight jar and jax-ws implementation provided by the JDK (liberty server distributed with MobileFirst does not have jaxws feature). – mdsma Sep 30 '15 at 09:07
  • @MilanSMA, Milan, this is wasting valuable debugging time. Since you have the project and you are the one experiencing the problem and would like help debugging it - provide something that we can run and debug. – Idan Adar Sep 30 '15 at 13:49
  • @milanSMA, Waiting to hear back from you. – Idan Adar Oct 04 '15 at 07:13

1 Answers1

0

Seems like we're unable to use java adapters with soap (Unsolvable Class conflicts with JaxB between JDK and Embedeeded Worklight Jar). Seems like it's an unsolved bug : Now IBM ask us to open an issue send our code to solve the problem. Well, to sum-up : There no solution. We're waiting next version hoping this problem solved.

SMAGreg
  • 48
  • 6