[ 
https://issues.apache.org/jira/browse/CXF-8770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17611476#comment-17611476
 ] 

Colm O hEigeartaigh commented on CXF-8770:
------------------------------------------

CXF 2.7.18 was released back in 2015, please try with a more recent version.

> ClassCastException with com.sun.org.apache.xerces.internal.dom.ElementNSImpl 
> in Java 11 and cxf-bundle:2.7.18 
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-8770
>                 URL: https://issues.apache.org/jira/browse/CXF-8770
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, JAX-WS Runtime, JAXB Databinding
>    Affects Versions: 3.4.2
>            Reporter: Retheesh
>            Priority: Blocker
>
> When upgrading Java 8 to 11, I am getting javax.xml dependency not found 
> error. We are also generating java class from wsdl and xsd, using cxf-codegen 
> plugin. That classes also uses these dependency. When tried adding the 
> javax.xml dependency explicitly, the build was success but getting the 
> following error while we are hitting the service.
> {code:java}
>  unwinding now
> java.lang.ClassCastException: class 
> com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to class 
> javax.xml.soap.SOAPElement 
> (com.sun.org.apache.xerces.internal.dom.ElementNSImpl is in module java.xml 
> of loader 'bootstrap'; javax.xml.soap.SOAPElement is in unnamed module of 
> loader 'app')
>         at 
> org.apache.cxf.binding.soap.saaj.SAAJStreamWriter.adjustOverlaidNode(SAAJStreamWriter.java:67)
>  ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at 
> org.apache.cxf.staxutils.OverlayW3CDOMStreamWriter.writeStartElement(OverlayW3CDOMStreamWriter.java:188)
>  ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at 
> org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:127)
>  ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at 
> org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:86)
>  ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at 
> org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:66)
>  ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
>  ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:570) 
> ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:479) 
> ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382) 
> ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335) 
> ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at 
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) 
> ~[cxf-bundle-2.7.11.jar:2.7.11]
>         at 
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135) 
> ~[cxf-bundle-2.7.11.jar:2.7.11]
> {code}
> I am using cxf-bundle 2.7.18 and cxf-codegen 3.4.2. Also I am using 
> org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.14.0. 
> Java version : open-jdk 11.0.5 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to