I just tried on a different server, Tomcat 8.0.33.
Same problem, getting 
java.lang.ClassCastException:
com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to
javax.xml.bind.JAXBElement at Line 195 in Soap11DataFormatAdapter.

It seems to be failing trying decoding
org.xmlsoap.schemas.soap.envelope.Detail.any field. It contains
ElementNSImpl instead of JAXBElement.

I was trying to register a custom JAXB element using a objectfactory class
as follows, that would hopefully handle the unkown 'text' tag:

@XmlRegistry
public class ObjectFactory {
        @XmlElementDecl( name= "text")
    JAXBElement<String> createText(String value) {
        return new JAXBElement<String>(new QName("text"), String.class,
value);
    }
}

How do I register the objectfactory on top of the route I have configured as
follows:

String contextPath = MultiTranRequest.class.getPackage().getName();
ElementNameStrategy elementNameStrategy = new
ServiceInterfaceStrategy(MultiTransactionMSPortType.class, true);

SoapJaxbDataFormat soapJaxbDataFormat = new SoapJaxbDataFormat(contextPath,
elementNameStrategy);
soapJaxbDataFormat.setFragment(true);
soapJaxbDataFormat.setPrettyPrint(false);

Is there a way on to register a global ObjectFactory on the
SpringCamelContext??? 

or is there something else I should be looking at??





--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-SoapFault-marshalling-classcast-exception-tp5781986p5782116.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to