So I tried what you all said. (And now I get it about the
springConfiguration).

My spring configuration now looks like that : 

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:jdbc="http://www.springframework.org/schema/jdbc";
       xmlns:camel="http://camel.apache.org/schema/spring";
       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://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
                http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>
        
        * <bean id="myDataSource" 
class="org.apache.commons.dbcp.BasicDataSource" 
                destroy-method="close"> 
                <property name="url" value="jdbc:mysql://172.27.178.73:3306/db" 
/> 
                <property name="driverClassName" value="com.mysql.jdbc.Driver" 
/> 
                <property name="username" value="dev" /> 
                <property name="password" value="mypassword" />
        </bean> *

</beans>


But now I get an error I don't really understand called
:"NoSuchBeanException"



Exception in thread "main" org.apache.camel.FailedToCreateRouteException:
Failed to create route route1 at: >>> Split[xpath{XPath:
/tabnames/tabname/subTrajectory/month} -> [...]],
To[jdbc:dataSource?useHeadersAsParameters=true] <<< in route:
Route(route1)[[From[file:src/data/xmlTest]] -> [Split[xpath{... because of
Failed to resolve endpoint: jdbc://dataSource?useHeadersAsParameters=true
due to: No bean could be found in the registry for: dataSource of type:
javax.sql.DataSource
        [...]
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: jdbc://dataSource?useHeadersAsParameters=true due to: No
bean could be found in the registry for: dataSource of type:
javax.sql.DataSource
        [...]
Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in
the registry for: dataSource of type: javax.sql.DataSource
        [...]


Do I need something more than camel-core and camel-jdbc in my pom.xml ? 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Configuring-database-with-jdbc-tp5753574p5753586.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to