You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Scott Came <sc...@search.org> on 2011/06/17 08:02:18 UTC

ClassCastException in org.apache.cxf.databinding.source.XMLStreamDataWriter

I have the following route:

<camel:route>
  <camel:from uri="cxf:bean:webservice1?dataFormat=PAYLOAD"/>
  <camel:to uri="xslt:xslt/xslt1.xsl"/>
  <camel:setHeader headerName="operationName"><constant>op1</constant></camel:setHeader>
  <camel:setHeader headerName="operationNamespace"><constant>http://myns</constant></camel:setHeader>
  <camel:to uri="xslt:xslt/SOAPWrapper.xsl"/>
  <camel:to uri="cxf:bean:webservice2?dataFormat=MESSAGE"/>
  <camel:to uri="xslt:xslt/xslt2.xsl"/>
  <camel:setHeader headerName="operationName"><constant>op2</constant></camel:setHeader>
  <camel:setHeader headerName="operationNamespace"><constant>http://myns2</constant></camel:setHeader>
  <camel:to uri="cxf:bean:webservice3?dataFormat=PAYLOAD"/>
</camel:route>

The beans webservice1, 2, and 3 are all defined as cxfEndpoints; I am pretty confident they are set up properly.

What emerges out of xslt2.xsl is a simple XML structure that conforms to the WSDL/schema for webservice3.

Everything works fine until the end (I can put a log message right before webservice3 is invoked, and see my  message structure as it is supposed to be after xslt2.  But when the route gets to the very last step, I get this:

java.lang.ClassCastException: org.apache.camel.component.cxf.CxfPayload cannot be cast to javax.xml.transform.Source
        at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:83)[131:org.apache.cxf.bundle:2.3.4]
        at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:50)[131:org.apache.cxf.bundle:2.3.4]
        at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:46)[131:org.apache.cxf.bundle:2.3.4]
        at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:119)[131:org.apache.cxf.bundle:2.3.4]
        at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)[131:org.apache.cxf.bundle:2.3.4]
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)[131:org.apache.cxf.bundle:2.3.4]
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:458)[131:org.apache.cxf.bundle:2.3.4]
        at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:94)[133:org.apache.camel.camel-cxf:2.6.0]
...

Any ideas?

Thanks.
--Scott