2008/7/24 Stephen J <[EMAIL PROTECTED]>:
>
> I have a camel route defined as follows:
>
> <route>
>                <from uri="amq:fruitTree"/>
>                <process ref="fruitHeaderInjector" />
>            <filter>
>                <xpath>$fruitType = 'apple'</xpath>
>                <to uri="velocity:templates/AppleTemplate.vm" />
>                <process ref="velocityProcessor" />
>            </filter>
>            <filter>
>                <xpath>$fruitType = 'orange'</xpath>
>                <to uri="velocity:templates/OrangeTemplate.vm" />
>            <process ref="velocityProcessor" />
>            </filter>
>   </route>
>
> where the route pulls a message from an ActiveMQ queue, then adds a header
> with the fruitHeaderInjector, then based on the xpath filter should process
> the message with one of the velocity templates defined.
>
> The only code in the process method of the header injector class is:
> exch.getIn().setHeader("fruitType", exch.getIn().getBody(String.class));
>
> When camel tries to process the xpath expression I get the following error:
> "Content is not allowed in prolog."
>
> Can someone tell me if I'm doing something wrong with the header processor,
> or if I've run into a bug?
> I have a junit test of the described application if that will help.

Is the payload of the message valid XML? Turn on trace to see...
http://activemq.apache.org/camel/tracer.html

my guess is you might have newlines before the first < character or something.


-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Reply via email to