我想在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