On Thu, Dec 9, 2010 at 3:46 PM, Remi Malessa <[email protected]> wrote: > Hi Claus. > > I've put my class in a jar and placed it in my ActiveMQ_home/lib folder. > Additionally I've placed a file called TypeConverter in > /META-INF/services/org/apache/camel/ directory of the jar > package. > > Inside the file I've put the package name of my type converter. > > I've tested the String to org.jdom.Document converter and it works fine. The > only problem is with > org.jdom.Document to java.lang.String. > > Here is my org.jdom.Document to java.lang.String method: > > �...@converter > public static String toString(org.jdom.Document pDocument, Exchange > pExchange){ > > Document tDocument = > pExchange.getIn().getBody(org.jdom.Document.class); > XMLOutputter tXMLOutputter = new XMLOutputter(); > return tXMLOutputter.outputString(tDocument); > } >
Add some system out or something to see if it pickup your type converter. And mind that Camel can only choose your type converter if the message body matches that type. So make sure the body isn't wrapped into something else. > > > Remi > > > > On 12/09/2010 02:36 PM, Claus Ibsen wrote: >> >> How do you register the converter? >> >> See more here >> http://camel.apache.org/type-converter.html >> >> Or chapter 3 in the Camel book >> > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
