You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by damien <da...@mq.edu.au> on 2014/04/28 08:21:57 UTC
org.apache.camel.language.simple.types.SimpleIllegalSyntaxException:
Binary operator is does not support token a at location 11
Hi,
The predict works fine in camel 2.8:
<camel:choice>
<when>
<simple>${body} is au.edu.mq.ClassA</simple>
<camel:convertBodyTo type="au.edu.mq.ClassB" />
</when>
</camel:choice>
But when I upgrade to camel 2.12, it's getting error:
Caused by:
org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: Binary
operator is does not support token a at location 11
${body} is au.edu.mq.ClassA
*
if I do conversion straightway without choice/when, it works. It looks like
the message body is fine, but simple expression can't recognise
au.edu.mq.ClassA.
What could be wrong here?
Thanks
Damien
--
View this message in context: http://camel.465427.n5.nabble.com/org-apache-camel-language-simple-types-SimpleIllegalSyntaxException-Binary-operator-is-does-not-supp1-tp5750642.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: org.apache.camel.language.simple.types.SimpleIllegalSyntaxException:
Binary operator is does not support token a at location 11
Posted by Charles Moulliard <ch...@gmail.com>.
Simple quote was required -->
@Test
public void testChoiceSimple() throws InterruptedException {
producer.sendBody("direct:input", classA);
mockMatch.expectedMessageCount(1);
Exchange exch = mockMatch.getExchanges().get(0);
Object obj = exch.getIn().getBody();
assertEquals("my.company.ClassA",obj.getClass().getName());
mockMatch.assertIsSatisfied();
}
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("direct:input")
.choice()
.when().simple("${body} is 'my.company.ClassA'")
.to("mock:match")
.otherwise()
.to("mock:do-not-match")
.endChoice(); }
};
}
On Mon, Apr 28, 2014 at 9:39 AM, damien <da...@mq.edu.au> wrote:
> That's the problem, it works now! Thanks a lot
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/org-apache-camel-language-simple-types-SimpleIllegalSyntaxException-Binary-operator-is-does-not-supp1-tp5750642p5750645.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
Re:
org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: Binary
operator is does not support token a at location 11
Posted by damien <da...@mq.edu.au>.
That's the problem, it works now! Thanks a lot
--
View this message in context: http://camel.465427.n5.nabble.com/org-apache-camel-language-simple-types-SimpleIllegalSyntaxException-Binary-operator-is-does-not-supp1-tp5750642p5750645.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: org.apache.camel.language.simple.types.SimpleIllegalSyntaxException:
Binary operator is does not support token a at location 11
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
You need to quote the class name, eg
<simple>${body} is 'au.edu.mq.ClassA'</simple>
On Mon, Apr 28, 2014 at 8:21 AM, damien <da...@mq.edu.au> wrote:
> Hi,
>
> The predict works fine in camel 2.8:
>
> <camel:choice>
> <when>
> <simple>${body} is au.edu.mq.ClassA</simple>
> <camel:convertBodyTo type="au.edu.mq.ClassB" />
> </when>
> </camel:choice>
>
> But when I upgrade to camel 2.12, it's getting error:
>
> Caused by:
> org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: Binary
> operator is does not support token a at location 11
> ${body} is au.edu.mq.ClassA
> *
>
> if I do conversion straightway without choice/when, it works. It looks like
> the message body is fine, but simple expression can't recognise
> au.edu.mq.ClassA.
>
> What could be wrong here?
>
> Thanks
> Damien
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/org-apache-camel-language-simple-types-SimpleIllegalSyntaxException-Binary-operator-is-does-not-supp1-tp5750642.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/