1 Reply Latest reply on Mar 29, 2012 8:59 PM by ffang

    still a problem with camel-jdbc and osgi

    sekaijin

      Hi.

      I have a bundle that defines a datasource

       

       

           <bean class="oracle.jdbc.pool.OracleDataSource" id="suiviDataSource">

                <property name="driverType" value="$" />

                <property name="serverName" value="$" />

                <property name="portNumber" value="$" />

                <property name="databaseName" value="$" />

                <property name="user" value="$The specified item was not found." />

                <property name="password" value="$" />

           </bean>

       

           <service id="suiviDataSourceService" interface="javax.sql.DataSource" ref="suiviDataSource">

                <service-properties>

                     <entry key="osgi.jndi.service.name" value="suiviDataSource">

                  <to uri="jdbc:suiviDataSource"/>

                  $</simple>                 <log message="*** Select all : $"/>

                  </split>

              </route>

        </camelContext>

      </blueprint>

       

      but I get:

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: jdbc://suiviDataSource due to: Could Be No bean found in the registry for: suiviDataSource of type: javax.sql.DataSource

       

      Registry reg = getContext().GetRegistry();

      dataSource = (DataSource) reg.lookup("osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=suiviDataSource)");

      returns the datasource. but

      Registry reg = getContext().GetRegistry();

      dataSource = (DataSource) reg.lookup ("jdbc/suiviDataSource");

      returns null

       

      how to declare the datasource for camel can use it?

      It is necessary that the datasource to be in a separate bundle as several bundles use it.

       

       

      thank

      A+JYT

      PS: sorry for my approximative english.