activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xokao <xokao1...@hotmail.com>
Subject Camel routing Exception on a byteMessage
Date Thu, 17 Jul 2008 10:40:38 GMT

My Routing config  is seted as follow:

	                       <from uri="activemq:0001"/>
				 <choice>
					 <when>
						<xpath>$foo = '1111'</xpath>
					    <to uri="activemq:queue:1111"/>
					</when>
					 <when>
						 <xpath>$foo = '2222'</xpath>
						 <to uri="activemq:queue:2222"/>
					</when>
				 <otherwise>
					 <to uri="activemq:queue:3333"/>
				 </otherwise>
				
			 </choice>

  it is all right  that when i  send a textmessage.
  but after  sent a bytemessage , it throwed  Exceptions (see at last):
  
  the more: i found  that if the content of textmessage is not set as a
XML-format(eg : <hello>hi</hello>); the console will throw  Exceptions just
like the first one i said.   But the same routing rule  i wrote in DSL , it
worked well , is this something wrong with my spirngxml config?  or  all
this due my  misuse of the xpath  expression?  
                                                          help needed  !!  



[Fatal Error] :1:1: Content is not allowed in prolog.
ERROR DeadLetterChannel              - Failed delivery for exchangeId:
ID-itisxo
kao/11349-1216290336312/0-3. On delivery attempt: 5 caught:
org.apache.camel.Run
timeCamelException: org.xml.sax.SAXParseException: Content is not allowed in
pro
log.
org.apache.camel.RuntimeCamelException: org.xml.sax.SAXParseException:
Content i
s not allowed in prolog.
        at
org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:326
)
        at
org.apache.camel.impl.converter.InstanceMethodTypeConverter.convertTo
(InstanceMethodTypeConverter.java:51)
        at
org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(Defaul
tTypeConverter.java:64)
        at
org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52)
        at
org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.ja
va:537)
        at
org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.jav
a:420)
        at
org.apache.camel.builder.xml.XPathBuilder.matches(XPathBuilder.java:9
8)
        at
org.apache.camel.builder.xml.XPathBuilder.matches(XPathBuilder.java:6
3)
        at
org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.ja
va:47)
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$Processor
ToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
        at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChanne
l.java:143)
        at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChanne
l.java:87)
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
essor.java:40)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:44)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:68)
        at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp
ointMessageListener.java:66)
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.doI
nvokeListener(AbstractMessageListenerContainer.java:531)
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.inv
okeListener(AbstractMessageListenerContainer.java:466)
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.doE
xecuteListener(AbstractMessageListenerContainer.java:435)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContai
ner.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:316)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContai
ner.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
cMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:887)

        at
org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
cMessageListenerInvoker.run(DefaultMessageListenerContainer.java:822)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
java:264)
        at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
umentBuilderImpl.java:292)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
        at
org.apache.camel.converter.jaxp.XmlConverter.toDOMDocument(XmlConvert
er.java:456)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:322
)
        ... 23 more
ERROR DeadLetterChannel              - Exchange[JmsMessage: [B@6f947b]
ERROR DeadLetterChannel              - Failed delivery for exchangeId:
ID-itisxo
kao/11349-1216290336312/0-3. Handled by the failure processor:
RecipientList[log
:org.apache.camel.DeadLetterChannel?level=error]

 
-- 
View this message in context: http://www.nabble.com/Camel-routing-Exception-on-a-byteMessage-tp18505795p18505795.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message