environment: windows, jdk1.6, Eclipse 3.4, SMX3.3, Camel 1.4
here is my camel route...pulls XML messages from a JMS topic, decodes them,
filters them, routes to a persister and outbound JMS topic...
from("jbi:service:http://test.com/eda/mpPipeline")
.to("jbi:service:http://test.com/eda/messageDecoder?mep=in-out")
.choice()
.when().xpath("count(//InboundMessage) = 1")
.multicast()
.to("jbi:service:http://test.com/messagePersister?mep=in");
.to("jbi:service:http://test.com/portalJMSService?mep=in");
here is the code from my servicemix-bean service unit class...it worked fine
before I added the multicast() to send to 2 destinations...
NormalizedMessage in = exchange.getMessage("in");
StringSource s = (StringSource) in.getContent();
and the error...
java.lang.ClassCastException:
org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache
cannot be cast to org.apache.servicemix.jbi.jaxp.StringSource
Clearly, the in.getContent() is returning a different Source class, but I'm
confused by the StreamCacheConverter$StreamSourceCache class. I don't even
have this class in my Camel service unit (generated from maven)...why? I
guess I can go find a JAR file that contains this and add it in...I'm just
confused why I have to do all this just to use a different Camel API?
Overall, I'm confused why the in.getContent() returns different Source
instances when the inbound data format hasn't changed at all...this has
caught me several times already. The strangest of which was when I turned
on JMS debugging and my Source went from a StreamSource to a DOMSource.
Currently, I have instanceof conditionals to handle all the cases...is there
a better approach to handling this?
thanks
--
View this message in context:
http://www.nabble.com/error-when-switching-Camel-route-from-to%28%29-to-multicast%28%29-tp24167728p24167728.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.