camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Python Expressions
Date Tue, 01 Jul 2008 14:15:53 GMT
What happens if you use trunk?

2008/7/1 Aaron Mulder <ammulder@alumni.princeton.edu>:
> So I'm also having trouble trying out Python expressions.  If I do this:
>
>        <route>
>            <from uri="activemq:topic:ScriptTest" />
>            <choice>
>                <when>
>                    <python>request.headers['console'] == 'Wii'</python>
>                    <to uri="bean:test?methodName=handleWii" />
>                </when>
>
> Then I get this:
>
> java.lang.NullPointerException
>        at org.apache.camel.builder.script.ScriptBuilder.matches(ScriptBuilder.java:457)
>        at org.apache.camel.builder.script.ScriptBuilder.matches(ScriptBuilder.java:83)
>        at org.apache.camel.builder.script.ScriptBuilder.matches(ScriptBuilder.java:49)
>        at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:47)
>        at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
>        at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:143)
>        at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:87)
>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
>        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:40)
> ...
>
> It almost seems like the Python expression is returning null instead
> of the expected boolean?  I tried putting a "return" in there to no
> avail.  If I mess up the syntax it says so (for example,
> request.headers.console does not work in Python), so it's doing
> *something* -- I just don't see why the expression isn't working.
>
> Any ideas?
>
>
> FWIW, so far I'm OK with EL, OGNL, Groovy, and JXPath.  No dice with
> Ruby or Python.
>
> Thanks,
>       Aaron
>



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

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

Mime
View raw message