javax.xml.ws.WebServiceException: java.lang.ClassCastException: com.sun.xml.ws.message.jaxb.JAXBHeader cannot be cast to com.sun.xml.ws.security.opt.impl.outgoing.SecurityHeader

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Stack Overflow by csDave
, 9 months ago
java.lang.ClassCastException: com.sun.xml.ws.message.jaxb.JAXBHeader cannot be cast to com.sun.xml.ws.security.opt.impl.outgoing.SecurityHeader
via Oracle Community by konkimalla, 1 year ago
java.lang.ClassCastException: com.sun.xml.ws.message.saaj.SAAJHeader cannot be cast to com.sun.xml.ws.security.opt.impl.outgoing.SecurityHeader
via ptcusercommunity.com by Unknown author, 1 year ago
java.lang.ClassCastException: com.sun.xml.ws.message.saaj.SAAJHeader cannot be cast to com.sun.xml.ws.security.opt.impl.outgoing.SecurityHeader
via nabble.com by Unknown author, 1 year ago
java.lang.RuntimeException: com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to com.sun.xml.ws.security.trust.impl.wssx.bindings.RequestSecurityTokenResponseType
javax.xml.ws.WebServiceException: java.lang.ClassCastException: com.sun.xml.ws.message.jaxb.JAXBHeader cannot be cast to com.sun.xml.ws.security.opt.impl.outgoing.SecurityHeader
at com.sun.xml.ws.security.opt.impl.JAXBFilterProcessingContext.setJAXWSMessage(JAXBFilterProcessingContext.java:166)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.secureOutboundMessage(SecurityTubeBase.java:383)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientRequestPacket(SecurityClientTube.java:323)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
at com.sun.xml.ws.client.Stub.process(Stub.java:464)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:174)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:91)
at com.sun.proxy.$Proxy57.listAddressByPostcode(Unknown Source)
at uk.co.example.eaddress.EAddrServiceTest.directAddressTest(EAddrServiceTest.java:95)
at uk.co.example.eaddress.EAddrServiceTest.main(EAddrServiceTest.java:41)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.