You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by kavan desai <ka...@barclays.com> on 2013/04/02 09:20:31 UTC

Camle sql error

Hi

I am sending following sql statement to get it executed via Camel-sql
component, which is giving following error.
select complianceid,orderid from WH_STG_ORDER where parentchildtype=# and
complianceid in (#,#,#) and currency=# and  tradedate =
to_date(#,'yyyymmdd') and ordtype is null

Error - 

org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
orderid from WH_STG_ORDER where parentchildtype=# and complianceid in
(#,#,#) and currency=# and  tradedate = to_date(#,'yyyymmdd') and ordtype is
null?dataSourceRef=dataSource, please check your classpath contains the
needed Camel component jar.
	at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:52)
	at
org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:85)
	at
org.apache.camel.processor.RecipientListProcessor.resolveEndpoint(RecipientListProcessor.java:219)


I have already added Camel-sql dependency. If I remove second select field
after ',' it works fine.
Following is camel configuration 

<route id="sqlRoute">
       
        <from uri="direct://dwh/sql-query"/>
       
       <setHeader
headerName="RuleCondition"><simple>${in.body.args[0]}</simple></setHeader>
       
       <setHeader
headerName="RuleQuery"><simple>sql://${in.body.args[0]}?dataSourceRef=dataSource</simple></setHeader>
       
       <transform><simple>in.body.args[1]</simple></transform>
       
        <to uri="report://request"/>
        <recipientList><header>RuleQuery</header></recipientList>
        <setHeader
headerName="RuleCondition"><constant>RuleCondition</constant></setHeader>
        <to uri="report://reply"/>
       <log message="${body}"/>
       
      </route>

I think ',' is not getting parsed properly,isn't it ?



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

Re: Camle sql error

Posted by Claus Ibsen <cl...@gmail.com>.
You can configure to use a different separator on the recipient list eip.

On Tue, Apr 2, 2013 at 11:12 AM, kavan desai <ka...@barclays.com> wrote:
> I tried to chage the header from RuleCondition to sql:RuleCondition however
> then query i am passing not executed at all.
>
>
> One of the reason is because of
> ',' in the select statement, the later part is trated as seperate camel
> message and for which end ponit not found.
>
> I am seeing following bebug statement -
>
> [02/04/13 12:25:01:001 SGT] DEBUG bean.BeanProcessor: Setting bean
> invocation result on the OUT message: [*select complianceid,orderid* from
> WH_STG_ORDER where parentchildtype=# and complianceid in (#,#,#) and
> currency=# and  tradedate = to_date(#,'yyyymmdd') and ordtype is null, [P,
> 1/SUBM/AS/1/20130221/smWZ3Mb/1, 1/SUBM/AS/1/20130221/smWZ7dC/1,
> 1/SUBM/AS/1/20130221/smX9TpH/1, JPY, 20130226]]
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camle-sql-error-tp5730191p5730203.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camle sql error

Posted by kavan desai <ka...@barclays.com>.
I tried to chage the header from RuleCondition to sql:RuleCondition however
then query i am passing not executed at all.


One of the reason is because of 
',' in the select statement, the later part is trated as seperate camel
message and for which end ponit not found.

I am seeing following bebug statement - 

[02/04/13 12:25:01:001 SGT] DEBUG bean.BeanProcessor: Setting bean
invocation result on the OUT message: [*select complianceid,orderid* from
WH_STG_ORDER where parentchildtype=# and complianceid in (#,#,#) and
currency=# and  tradedate = to_date(#,'yyyymmdd') and ordtype is null, [P,
1/SUBM/AS/1/20130221/smWZ3Mb/1, 1/SUBM/AS/1/20130221/smWZ7dC/1,
1/SUBM/AS/1/20130221/smX9TpH/1, JPY, 20130226]]



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

Re: Camle sql error

Posted by Willem jiang <wi...@gmail.com>.
Hi

You didn't specify the right header for the <recipientList>.
It should be start with "sql:xxx" not the sql string that you want to send to.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, April 2, 2013 at 3:20 PM, kavan desai wrote:

> Hi
>  
> I am sending following sql statement to get it executed via Camel-sql
> component, which is giving following error.
> select complianceid,orderid from WH_STG_ORDER where parentchildtype=# and
> complianceid in (#,#,#) and currency=# and tradedate =
> to_date(#,'yyyymmdd') and ordtype is null
>  
> Error -  
>  
> org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
> orderid from WH_STG_ORDER where parentchildtype=# and complianceid in
> (#,#,#) and currency=# and tradedate = to_date(#,'yyyymmdd') and ordtype is
> null?dataSourceRef=dataSource, please check your classpath contains the
> needed Camel component jar.
> at
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:52)
> at
> org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:85)
> at
> org.apache.camel.processor.RecipientListProcessor.resolveEndpoint(RecipientListProcessor.java:219)
>  
>  
> I have already added Camel-sql dependency. If I remove second select field
> after ',' it works fine.
> Following is camel configuration  
>  
> <route id="sqlRoute">
>  
> <from uri="direct://dwh/sql-query"/>
>  
> <setHeader
> headerName="RuleCondition"><simple>${in.body.args[0]}</simple></setHeader>
>  
> <setHeader
> headerName="RuleQuery"><simple>sql://${in.body.args[0]}?dataSourceRef=dataSource</simple></setHeader>
>  
> <transform><simple>in.body.args[1]</simple></transform>
>  
> <to uri="report://request"/>
> <recipientList><header>RuleQuery</header></recipientList>
> <setHeader
> headerName="RuleCondition"><constant>RuleCondition</constant></setHeader>
> <to uri="report://reply"/>
> <log message="${body}"/>
>  
> </route>
>  
> I think ',' is not getting parsed properly,isn't it ?
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camle-sql-error-tp5730191.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).