3 Replies Latest reply on Apr 14, 2009 2:00 AM by Claus Ibsen

    Camel - WARNING

    François FOUQUET Newbie

      Hi ,


      I have I stange problem with camel SU


      When I start the activity by a timer there is no problem

      But when I call it from An http consumer from another SU I have warning

      19:00:58,145 | WARN  | seda:request thread:22 | JbiBinding               | he.servicemix.camel.JbiBinding   68 | Unable to convert message body of type class java.util.ArrayList into an XML Source



      After a lot of warning ( the same nomber of the splitter part ) the result is correct and passe to the other endpoint




      hier is my code camel




      Thanks by advance for your help



      .setBody(constant("select * from table"))





        • 1. Re: Camel - WARNING
          Claus Ibsen Master

          When you send data back to the JBI endpoint with



          You should make sure the data is XML based. So for instance the process(processResult) should set the body in the exchange as XML based.

          • 2. Re: Camel - WARNING
            François FOUQUET Newbie


            Thanks for your help, I'm very happy to found reply to my problem so quickly on this forum.


            So I'm agree to you, the message body must be in XML format, but I think that I have made that correctly. I send who my process methode to check . By the way after 30 secondes of warning the XML bases messages build by the process methode are send and receve on the next JMS JBI endpoint so the body is correctly.



            Hier is my process methode , strangly it  work very well when camel is initiate by internal timer ,

            and there is warning only when camel is initiate by an http binding component.

            In the two case the input MEP is in-only.


            Any other idea ?

            Thanks by advance



                 private Processor processResult = new Processor() {


                      private Element mapping(HashMap res,String newelem,String oldelem){

                           Element newelement = new Element(newelem);


                           return newelement;



                      public void process(Exchange exchange) throws Exception {

                                Message in = exchange.getIn();

                                HashMap<String, Object> res = in.getBody(HashMap.class);

                                Element racine = new Element("naf");

                                org.jdom.Document document = new org.jdom.Document(racine);






                                XMLOutputter serializer = new XMLOutputter();

                            String msg = serializer.outputString(document);

                                exchange.getOut(true).setBody(msg, String.class);




            • 3. Re: Camel - WARNING
              Claus Ibsen Master



              I am a bit puzzled where the java.util.List comes into the picture? You processor set the body as a plain String that is XML based.


              Can you try setting the body without the type convertions



              Also you can enable the tracer in Camel that dumps the message structure to help us see where the java.util.List comes into play


              See about tracer here:



              Basically adding this code to the route builder:

              getContext().addInterceptStrategy(new Tracer());