我想在Apache Karaf中使用Oracle jdbc 6驱动程序购买我面临一些困难。特别是,我试图使用驱动程序通过Camel SQL组件访问我的数据库。在Karaf中使用Apache驱动程序和Apache Camel SQL组件
我的蓝图文件看起来像这样:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close">
<property name="dataSourceName" value="XXXXX" />
<property name="TNSEntryName" value="XXXXX" />
<property name="DriverType" value="XXXXX" />
<property name="user" value="XXXXX" />
<property name="password" value="XXXXX" />
</bean>
<!-- configure the Camel SQL component to use the JDBC data source -->
<bean id="sql" class="org.apache.camel.component.sql.SqlComponent">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent">
<property name="location" value="file:${karaf.home}/etc/sqlStatements.properties" />
</bean>
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="metis123">
<from uri="timer:foo?period=5000" />
<to uri="sql:{{sql.check_rwos_update}}" id="sqlCheckRwosUpdate" />
<to uri="log:com.hveiga?showAll=true" />
</route>
</camelContext>
</blueprint>
当我把我的文件到deploy
目录Karaf我得到以下异常:
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to instantiate components
...
Caused by: java.lang.NoClassDefFoundError: javax/sql/DataSource
...
Caused by: java.lang.ClassNotFoundException: javax.sql.DataSource not found by oracle.ojdbc6 [131]
所以,现在看来,这是一个问题与oracle驱动程序无法找到某些类。我有osgified使用apache-felix maven插件的oracle jar,但也许我做错了什么,并且MANIFEST.MF文件丢失了一些东西。
任何想法我可能会失踪?
你能解释你做什么来安装你的蓝图。从一个新的karaf(哪个版本)开始。你肯定会以某种方式安装oracle驱动程序。 –
要安装我的蓝图,我只需将xml和oracle驱动程序jar文件放入deploy目录即可。 Karaf版本是2.3.3。 – hveiga