• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Webservice over WAS: Help with ClassCastException... incompatible with javax.xml.bind.JAXBElement

 
Marcelo Tataje
Ranch Hand
Posts: 64
Java Oracle Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've finally deployed my WebService based on my WSDL, but I have a problem when I try to consume the WebService. I've just implemented "Create" method that receives an XML file as parameter and copies it to another directory. When I execute the client, at first, it seems to copy the file successfully in the folder, but when I execute it for the second time I'm getting this:

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: java.lang.ClassCastException: org.w3._2009._02.ws_tra.Create incompatible with javax.xml.bind.JAXBElement
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:190)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:123)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:120)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:90)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:119)
at $Proxy27.create(Unknown Source)
at org.busdox.transport.start.client.AccessPointClient.send(AccessPointClient.java:176)
at org.busdox.transport.start.client.AccessPointClient.send(AccessPointClient.java:78)
at com.alfa1lab.sample.impl.transport.client.Main.testService(Main.java:139)
at com.alfa1lab.sample.impl.transport.client.Main.SendMessageToAccessPoint(Main.java:79)
at com.alfa1lab.sample.impl.transport.client.Main.main(Main.java:62)

I'm using RAD, WebSphere Application Server 7 and Web Features Pack 2.

Don't know the cause of why I'm getting that error

Thanks in advance. I'll be really grateful if somebody could help me please
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic