Hi,

This error generally means that can't find camel-jdbc component from classpath.
Try add camel-jdbc dependency also into your pom.xml.
Take a look at [1] to get more details.

[1]http://camel.apache.org/jdbc.html
Freeman
On 2011-12-27, at 上午9:37, JKemp wrote:

Hey guys,

I'm having issues putting a JDBC component into my route. I keep seeing
this error when trying to create my route:

"InvocationTargetException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[jdbc:dataSource] <<< in route: Route[[From[timer://JDBCTestTimer?period=60s]] -> [Bean[com.... because of Failed to resolve endpoint: jdbc://dataSource due to: No component found
with scheme: jdbc"

I originally had the issue while packaging the component in a war for
deployment in tomcat, but I recreated the issue using a Java/Spring
implementation based on the camel-archetype-java maven archetype.

I've been trying to follow the examples online, but I keep getting the above
error.

Here's what I have for my route builder class:

public class MyRouteBuilder extends RouteBuilder {

   /**
    * A main() so we can easily run these routing rules in our IDE
    */
   public static void main(String... args) throws Exception {
       Main.main(args);
   }

   /**
    * Lets configure the Camel routing rules using Java code...
    */
   public void configure() {
       from("timer://JDBCTestTimer?period=60s").bean(new
StrategyInfoProcessor()).to("jdbc:dataSource").bean(new
StrategyResponseProcessor());

   }
}

And here's what I have for my camel-context.xml:



<beans xmlns="http://www.springframework.org/schema/beans";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation="
      http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
      http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>

   <bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
       <property name="url" value="jdbc:hsqldb:mem:camel_jdbc"/>
       <property name="username" value="sa"/>
       <property name="password" value=""/>
   </bean>


   <bean id="updateStrategyProcessor"
class="test.CamelJava.StrategyInfoProcessor"/>
   <bean id="strategyResponseProcessor"
class="test.CamelJava.StrategyResponseProcessor"/>
        
 <camelContext xmlns="http://camel.apache.org/schema/spring";>
   <package>test.CamelJava</package>
 </camelContext>

</beans>

I also have these dependencies specified in my pom.xml:

 <dependencies>
   <dependency>
     <groupId>org.apache.camel</groupId>
     <artifactId>camel-core</artifactId>
     <version>2.9.0-RC1</version>
   </dependency>
   <dependency>
     <groupId>org.apache.camel</groupId>
     <artifactId>camel-spring</artifactId>
     <version>2.9.0-RC1</version>
   </dependency>


   <dependency>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-api</artifactId>
     <version>1.6.1</version>
   </dependency>
   <dependency>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-log4j12</artifactId>
     <version>1.6.1</version>
   </dependency>
   <dependency>
     <groupId>log4j</groupId>
     <artifactId>log4j</artifactId>
     <version>1.2.16</version>
   </dependency>
                
   <dependency>
          <groupId>org.springframework</groupId>
     <artifactId>spring-core</artifactId>
     <version>3.0.5.RELEASE</version>
   </dependency>
                
        <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>3.0.5.RELEASE</version>
        </dependency>
                
   <dependency>
       <groupId>hsqldb</groupId>
       <artifactId>hsqldb</artifactId>
       <version>1.8.0.7</version>
   </dependency>
 </dependencies>

Also, I'm using Java 1.6.0_26.

Does anyone have any idea what I'm doing wrong here? I've been struggling with this for a few days now, but I just can't seem to find where my problem
is.

Any help would be greatly appreciated.

Thanks.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Issues-with-resolving-a-JDBC-component-tp5102280p5102280.html
Sent from the Camel - Users mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com









Reply via email to