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);
    }



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

Reply via email to