Are you sure the message actually contains a valid XML document? Try adding a log endpoint in the route to see what the message looks like
2008/5/21 rmunjuluri <[EMAIL PROTECTED]>: > > Hello, > > I am trying out simple content based routing of the following messages: > > <Person> > <FirstName>John</FirstName> > <LastName>Smith</LastName> > <Destination>A</Destination> > </Person> > > <Person> > <FirstName>John</FirstName> > <LastName>Smith</LastName> > <Destination>B</Destination> > </Person> > > I would like for the first message (Destination=A) to go to a JMSQueue > (Camel.A) in JBoss and the second message (Destination=B) to go to a > JMSQueue (Camel.B) in JBoss. I have the endpoints configured but when I send > these two messages to a CamelContext > ============================== > <camelContext id="ContentBasedRouter" > xmlns="http://activemq.apache.org/camel/schema/spring"> > <route> > <from > uri="jbi:endpoint:http://consumers.pictor.com//CamelContentBasedRouterService/CamelContentBasedRouterEndpoint"/> > <choice> > <when> > <xpath>/Person/Destination='A'</xpath> > <to > uri="jbi:service:http://services.pictor.com//CamelAJMSProvider"/> > </when> > <when> > <xpath>/Person/Destination='B'</xpath> > <to > uri="jbi:service:http://services.pictor.com//CamelBJMSProvider"/> > </when> > </choice> > </route> > </camelContext> > ============================== > this is the exception I get > INFO - LogTask - Logging system reconfigured using > file: file:conf/log4j.xml > [Fatal Error] :-1:-1: Premature end of file. > ERROR - DeadLetterChannel - Failed delivery for exchangeId: > ID-enterprise/4930-1211338934640/0-0. > On delivery attempt: 0 caught: org.apache.camel.RuntimeCamelException: > org.xml.sax.SAXParseException: Prematu > re end of file. > org.apache.camel.RuntimeCamelException: org.xml.sax.SAXParseException: > Premature end of file. > at > org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:326) > at > org.apache.camel.impl.converter.InstanceMethodTypeConverter.convertTo(InstanceMethodTypeConverter.j > ava:50) > at > org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:64) > at > org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52) > at > org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:537) > > Is there something wrong with my camel-context.xml ? > > thanx > -ram > -- > View this message in context: > http://www.nabble.com/Content-Based-Routing-of-simple-XML-docs---tp17355033s22882p17355033.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com
