0

I am getting a NullPointerException while invoking a REST webservice hosted on Tomcat. The route looks something like:

    <route>
        <from uri="rabbitmq:exchange:queue"/>
    <to uri="http://localhost:8080/rest-webservice/service/execute?message=${body}" /></route>

I have written a custom type convertor which converts the object I read from the rabbitMQ into a String XML. I need to send this as a parameter to the web service.

I used the &lt;log message="message: ${body}" /&gt; after reading from the rabbitMQ and the type convertor successfully converts the object into String.

Caused by: org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: org.apache.commons.httpclient.methods.RequestEntity with value

Siddharth
  • 9,349
  • 16
  • 86
  • 148
Punit Shah
  • 15
  • 4

1 Answers1

1

You can't use dynamic expressions like ${body} in the to operation in an endpoint URI. Use recipientList instead if you need to compute a URI dynamically: http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

Alexander Durnev
  • 341
  • 2
  • 13