I know that there are a lot of information about this, but it is second week while searching through various posts, but I cannot find any solution.
Simple scenario: I need datasource bean, to use it with JDBC component. I've created db.xml for datasource: <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> <bean class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" id="datasourceBean"> <property name="serverName" value="localhost"></property> <property name="databaseName" value="camel"></property> <property name="port" value="3306"></property> <property name="user" value="camel"></property> <property name="password" value="camel"></property> </bean> <service id="datasourceService" interface="javax.sql.DataSource" ref="datasourceBean"> <service-properties> <entry key="osgi.jndi.service.name" value="MyDataSource"></entry> </service-properties> </service> </blueprint> This bundle is started and provides required services: Bundle 231 provides: -------------------- objectClass = javax.sql.DataSource osgi.jndi.service.name = MyDataSource osgi.service.blueprint.compname = datasourceBean service.id = 185 ---- objectClass = org.osgi.service.blueprint.container.BlueprintContainer osgi.blueprint.container.symbolicname = db.xml osgi.blueprint.container.version = 0.0.0 service.id = 194 but when I add route: <route> <from uri="timer://kickoff?period=5000"/> <setBody> <constant>select * from Candles</constant> </setBody> <convertBodyTo type="java.lang.String"/> <to uri="log:RECEIVED?level=WARN"/> <to uri="jdbc:MyDataSource"/> </route> It fails to start: Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: jdbc://datasourceService due to: No bean could be found in the registry for: datasourceService of type: javax.sql.DataSource at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:456) at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48) at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:183) at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106) at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112) at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61) at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55) at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:440) at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:178) at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:852) ... 31 more Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: datasourceService of type: javax.sql.DataSource at org.apache.camel.util.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:128) at org.apache.camel.component.jdbc.JdbcComponent.createEndpoint(JdbcComponent.java:49) at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91) at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:438) ... 40 more How to access the registry? Maybe service property name is wrong? What else could be changed? I would appreciate any help, because at the moment I feel desperate. -- View this message in context: http://camel.465427.n5.nabble.com/ServiceMIx-Camel-JDBC-MySql-javax-sql-DataSource-not-found-tp5715323.html Sent from the Camel - Users mailing list archive at Nabble.com.
