0

I am trying to access a MS SQL database with apache camel. I am building it with maven as a bundle and deploy it on apache karaf.To do this I got the following in my blueprint.xml

<bean id="dataSource" class="net.sourceforge.jtds.jdbcx.JtdsDataSource">
     <property name="url" value="" />
     <property name="user" value="paygate" />
     <property name="password" value="" />
</bean>

<service interface="javax.sql.DataSource" ref="dataSource">
    <service-properties>
        <entry key="osgi.jndi.service.name" value="jdbc/mssqlDatasource" />
    </service-properties>
</service>

But now I am getting the following in my karaf logs

missing requirement [1374.6] osgi.wiring.package; (osgi.wiring.package=net.sourceforge.jtds.jdbcx)

This is the class that also was generated when creating the datasource in karaf with 'jdbc:create'.

Why doesn't karaf find that class?

Milla
  • 403
  • 1
  • 5
  • 22

2 Answers2

1

Install the jtds jar as a bundle , using the command :

install -s wrap:mvn: net.sourceforge.jtds /jtds/1.3.0 

Change version number to match your jar version, that will resolve the problem.

Ashoka
  • 935
  • 7
  • 20
0

It is the MSSQL datasource,

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"/>
    <property name="url" value="jdbc:jtds:sqlserver://localhost:1433;databaseName=testdb"/>
    <property name="username" value="sa"/>
    <property name="password" value="root"/>
</bean>

Then you should install dbcp and jtds dependency in karaf container. It is working fine.

Sridhar
  • 89
  • 7