Skip to main content

ClassCastException: X cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
markus_franke
Offline
Joined: 2007-10-10

Atfer upgrading from Metro 1.5 to Metro 2.01 I am struggling with a ClassCastException:

<font color="#ff0000" size="1"><font color="#ff0000" size="1"><p align="left">07.01.2011 14:06:05 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized</p><p align="left">SCHWERWIEGEND: WSSERVLET11: failed to parse runtime descriptor:</p></font></font><u><font color="#000080" size="1"><font color="#000080" size="1">java.lang.ClassCastException</font></font><font color="#ff0000" size="1"><font color="#ff0000" size="1">: com.siemens.dxa.generated.applications.webservices.common.types.xmldsig_core.ManifestType$JaxbAccessorF_reference cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor</font></font><u><font color="#000080" size="1"><font color="#000080" size="1"><p align="left">java.lang.ClassCastException</p><p align="left">at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(</p><p align="left">at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(</p><p align="left">at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(</p><p align="left">at com.sun.xml.bind.v2.runtime.property.ArrayProperty.&lt;init&gt;(</p><p align="left">at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.&lt;init&gt;(</p><p align="left">at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.&lt;init&gt;(</p><p align="left">at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.&lt;init&gt;(</p><p align="left">at sun.reflect.GeneratedConstructorAccessor80.newInstance(Unknown Source)</p><p align="left">...</p></font></font></u></u>
I am running Jetty 6.1.19 inside Equinox 3.5.1 with JDK6. At compiletime I endorse jsr173_api.jar, webservices-api.jar, and webservices-extra-api.jar. At runtime I endorse additionally xml-apis-2.10.0.jar.
The deployed WS is a provisioning WS just implementing SPML1 and SPML2 which imports the default XSD files for SAML (cs-sstc-schema-assertion-01.xsd) and XMLDsig (xmldsig-core-schema.xsd) as provided by the OASIS / W3C. We did not apply any special bindings accept renaming the Java package names.
So what do you think, is it a classpath problem (endorsing, mixed JAR files) or what else?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
markus_franke
Offline
Joined: 2007-10-10

Seems to be a classloading / endorsing issue. When endorsing webservices-api.jar and jaxb-impl.jar (as provided by JAXB2_20110115.jar) the ClassCastException disappeared. But now I am struggling with an "XWSSecurityException: Signature verification failed" issue.
But for this issue I will open another thread.