Hi ,
I am using following route

  <route id="route1">
           <from uri="servlet:///application1"/>
            <transform>
                <method bean="databaseBean" method="generateInsertData"/>
          </transform>
           <to uri="sql:{{sql.insertOrder}}"/>
            <to uri="activemq:queue:inbox"/>
       </route>

the DatabaseBean class contains following method :

public Map generateInsertData(String headerId1)
        {
                Map<String, Object> answer = new HashMap<String, Object>();
                     answer.put("reqId","111");
                     answer.put("msg","tesing the database insertion");
                return answer;
        }


and my sql property file contains following query :

sql.insertOrder=insert into camel_table (req_id,msg) values (:#reqId, :#msg)

the table is already created in oracle database.

when the route gets called, i get following exception :

No body available of type: java.io.InputStream but has value: {reqId=111,
msg=tesing the database insertion} of type: java.util.HashMap on:
JmsMessage[JmsMessageID: ID:xyz-b4be0c20ddf-4261-1372226226246-3:5:1:1:1].
Caused by: No type converter available to convert from type:
java.util.HashMap to the required type: java.io.InputStream with value
{reqId=111, msg=tesing the database insertion}.
Exchange[JmsMessage[JmsMessageID:
ID:xyz-b4be0c20ddf-4261-1372226226246-3:5:1:1:1]]. Caused by:
[org.apache.camel.NoTypeConversionAvailableException - No type converter
available to convert from type: java.util.HashMap to the required type:
java.io.InputStream with value {reqId=111, msg=tesing the database
insertion}]


----------
I followed the tutorial for camel sql and tried to implement the above code,
but I am not understanding where I am going wrong.
Searched for other posts , but still did not get any solution




--
View this message in context: 
http://camel.465427.n5.nabble.com/getting-error-with-camel-sql-component-in-route-tp5734785.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to