camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dealbitte <>
Subject Bean binding @Body and Exchange
Date Thu, 05 Jul 2012 09:33:40 GMT

I have the following camel route (defined in blueprint)



In the method "createXML(Exchange exchange)", I create a Document
(org.w3c.dom.Document) and set it as a exchange Body as follows:


Accessing the Document element in the subsequent method "printXML(Exchange
exchange)" via 

Document xmlDoc = (Document) exchange.getIn().getBody();

does not work as I get the exception "java.lang.AbstractMethodError" as soon
as I drop a file in the dropBox. But if I change the method signature to
"printXML(@Body Document xmlDoc)" 

I can retrieve the Document element without any issues. My question would
1. what is the difference, retrieving the Body via annotation (@Body) and
via "exchange.getIn().getBody()"
2. If I use @Body annotation, how can access the 'exchange' inside
'printXML' as I need to set the body of the outgoing message.

Please share your comments.


View this message in context:
Sent from the Camel - Users mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message