camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shiv <shiv.dixit....@gmail.com>
Subject Re: java.lang.NullPointerException in Camel JDBC component for Select statement
Date Wed, 07 May 2014 08:32:14 GMT
Finally i got the root cause of issue and fixed it. It was not actually
related to classpath but it was caused due to wrong DB connection string.

It was defined as <property name=&quot;url&quot;
value=&quot;jdbc:microsoft:sqlserver://&lt;hostname>:1433;DatabaseName=testdb"/>

as per info from Fuse ESB page JDBC page (table 6) but it should be
<property name=&quot;url&quot;
value=&quot;jdbc:sqlserver://&lt;hostname>:1433;DatabaseName=testdb"/>

Post changes I am able to run select query.

Now I am trying with SQL language in my querying. I copied
camel-script-2.2.0 and camel-josql-2.2.0 jars. My route is as below:

<from uri="timer://kickoff?period=5000"/>
<setBody>
	<sql>select * from test</sql>
</setBody>
<to uri="jdbc:testdb"/>

But it is giving below exception:
2014-05-07 12:35:04,158 | DEBUG | Failed delivery for exchangeId:
278c5aa1-4605-407c-bb38-173521a45fe3. On delivery attempt: 0 caught:
java.lang.IllegalArgumentException: No script engine could be created for:
sql | org.apache.camel.processor.DeadLetterChannel | kickoff

2014-05-07 12:35:04,165 | DEBUG | Failed delivery for exchangeId:
278c5aa1-4605-407c-bb38-173521a45fe3. On delivery attempt: 0 caught:
org.apache.camel.InvalidPayloadException: No body available of type:
java.lang.String on: Message: [Body is null]. Caused by: No type converter
available to convert from type: null to the required type: java.lang.String
with value null. Exchange[Message: [Body is null]]. Caused by:
[org.apache.camel.NoTypeConversionAvailableException - No type converter
available to convert from type: null to the required type: java.lang.String
with value null] | org.apache.camel.processor.DefaultErrorHandler | kickoff
2014-05-07 12:35:04,166 | ERROR | Failed delivery for exchangeId:
278c5aa1-4605-407c-bb38-173521a45fe3. Exhausted after delivery attempt: 1
caught: org.apache.camel.InvalidPayloadException: No body available of type:
java.lang.String on: Message: [Body is null]. Caused by: No type converter
available to convert from type: null to the required type: java.lang.String
with value null. Exchange[Message: [Body is null]]. Caused by:
[org.apache.camel.NoTypeConversionAvailableException - No type converter
available to convert from type: null to the required type: java.lang.String
with value null] | org.apache.camel.processor.DefaultErrorHandler | kickoff
org.apache.camel.InvalidPayloadException: No body available of type:
java.lang.String on: Message: [Body is null]. Caused by: No type converter
available to convert from type: null to the required type: java.lang.String
with value null. Exchange[Message: [Body is null]]. Caused by:
[org.apache.camel.NoTypeConversionAvailableException - No type converter
available to convert from type: null to the required type: java.lang.String
with value null]
	at
org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:103)
	at
org.apache.camel.processor.ConvertBodyProcessor.process(ConvertBodyProcessor.java:55




--
View this message in context: http://camel.465427.n5.nabble.com/java-lang-NullPointerException-in-Camel-JDBC-component-for-Select-statement-tp5750783p5750943.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message