camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Trying to add JdbcComponent to CamelContext
Date Mon, 02 Nov 2009 04:38:38 GMT
On Mon, Nov 2, 2009 at 3:04 AM, kodcanavari <kodcanavari@gmail.com> wrote:
>
>
> When i do
>
> InitialContext initialContext = new InitialContext();
> DataSource ds = (DataSource)initialContext.lookup("jdbc_1");
>
> JdbcComponent jdbcComponent = new JdbcComponent();
> jdbcComponent.setDataSource(dataSource);
>
> camelContext.addComponent("jdbc", jdbcComponent);
>
> How can i use this component in order to send jdbc queries?
> When i make from("xx").to("jdbc") i got the following trace :
>
> thanks.
>
>        at java.lang.Thread.run(Thread.java:619)
> 2009-11-02 02:58:29,703 : LoggerService.log : [ERROR] RouteFileJdbc :
> [RouteFileJdbc-0] The callback method start has thrown an exception : No
> endpoint could be found for: jdbc, please check your classpath c
> ontains the needed camel component jar.

You need to add camel-jdbc.jar to the classpath.





> org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
> jdbc, please check your classpath contains the needed camel component jar.
>        at
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:54)
>        at
> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:138)
>        at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:99)
>        at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:105)
>        at
> org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:64)
>        at
> org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:58)
>        at
> org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:250)
>        at
> org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:95)
>        at
> org.apache.camel.impl.DefaultRouteContext.createProcessor(DefaultRouteContext.java:95)
>        at
> org.apache.camel.model.SplitDefinition.createProcessor(SplitDefinition.java:80)
>        at
> org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:276)
>        at
> org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:116)
>        at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:439)
>        at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:126)
>        at
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:569)
>        at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:924)
>        at
> org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:517)
>        at
> org.apache.camel.builder.RouteBuilder.populateRoutes(RouteBuilder.java:270)
>        at
> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:260)
>        at
> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:241)
>        at
> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:507)
>        at
> org.ow2.jonas.camel.wrapper.CamelWrapper.addRoutes(CamelWrapper.java:145)
>        at
> org.ow2.jonas.camel.service.impl.CamelService.__addRoutes(CamelService.java:180)
>        at
> org.ow2.jonas.camel.service.impl.CamelService.addRoutes(CamelService.java)
> --
> View this message in context: http://old.nabble.com/Trying-to-add-JdbcComponent-to-CamelContext-tp26155434p26155434.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message