L.S.,

This is probably being caused by sending a StreamSource (which can only be read once) to this Camel route (e.g. a servicemix-file/servicemix-ftp poller would do this). If this is the case, you can fix this by either:
- setting the log level in ServiceMix to DEBUG
- rebuild Camel/ServiceMix locally to use the fix that is in Camel 1.4-SNAPSHOT (take a look at this thread [1] for more information)

Gert

[1] http://www.nabble.com/-jira--Created%3A-(CAMEL-516)-Camel-routes-only-work-when-org.apache.servicemix-log-level-is-set-to-DEBUG-td17264649s22882.html

Bruce Snyder wrote:
On Tue, May 20, 2008 at 9:07 PM, rmunjuluri <[EMAIL PROTECTED]> wrote:
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 ?

I'm not exactly sure about the error, but the XPath queries are not
valid. If you want to look at the text in the Destination element, the
following is a valid XPath query to grab that text:

/Person/Destination/text() = 'A'

Give that a try.

Bruce

Reply via email to