I am not able to get dbcp2 working in JBoss fuse 6.3. The code given below works fine in Fuse container.
<bean id="oracleDSTest" class="oracle.jdbc.pool.OracleDataSource"
destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:XE" />
<property name="username" value="hr" />
<property name="password" value="hr" />
<property name="maxIdle" value="5" />
<property name="minIdle" value="1" />
<property name="initialSize" value="1" />
</bean>
<service interface="javax.sql.DataSource" ref="oracleDSTest">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/oracleDSTest" />
<entry key="datasource.name" value="oracleDSTest" />
</service-properties>
</service>
But if I use org.apache.commons.dbcp.BasicDataSource
instead of oracle.jdbc.pool.OracleDataSource
it fails with the following error:
Error executing command: oracle.jdbc.driver.T4CConnection.isValid(I)Z
What could be the reason for this error?
I am using
ojdbc6-11.2.0.3.jar
and the driver works in both configurations.I tested it with a query from JBoss Fuse Console
Check that JDBC and JNDI are installed
You can drop an XML file with the following content into
deploy/
to automagically have a datasource deployed.OracleDataSource
BasicDataSource
Classloading
Please mind that this version of Oracle JDBC driver is not OSGi ready. To get everything to work under OSGi you may want to export Oracle classes from the System bundle.
Copy
ojdbc6-11.2.0.3.jar
(or your version) tolib/
folder of JBoss Fuse.Edit
etc/config.properties
and add the packages toorg.osgi.framework.system.packages
propertyReboot and check with
exports | grep oracle