camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gert Villemos <gville...@yahoo.de>
Subject Re: Routing based on exchange IN message body clas
Date Tue, 19 Apr 2011 15:37:31 GMT
There seems to be a limitation that makes this impossible; the 'Simple'
evaluation doesnt seem able to access methods that are inherited. I thus
cant access the 'class', as the getClass method is inherited. The route 

<simple>${body.getClass.getName} ==
'org.hbird.exchange.type.Parameter'}</simple>                

Thus fails with the error trace 

Caused by: org.apache.camel.component.bean.MethodNotFoundException: Method
with name: getClass not found on bean:
org.hbird.exchange.type.Parameter@2d83e895. Exchange[Message:
org.hbird.exchange.type.Parameter@2d83e895]
	at
org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:164)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:150)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)
	at
org.apache.camel.language.bean.BeanExpression$InvokeProcessor.process(BeanExpression.java:136)
	at
org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:207)

I have tried creating my own accessor method on my class and then the route
works. It only seem because the getClass is an inherited method, or maybe
because it doesnt return a string but that is not what the exception states.

--
View this message in context: http://camel.465427.n5.nabble.com/Routing-based-on-exchange-IN-message-body-clas-tp4313282p4313583.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message