I'm developing a simple aplication that must have access to an Oracle 10g DB and that is running under a JBoss EAP 6.1.0 server. I have followed the steps given on the official guide in order to install the Oracle driver.
So currently, I have the following config files. I added folder jboss-eap-6.1\modules\com\oracle\db\main
with ojdbc6.jar
and module.xml
, with content:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.oracle.db">
<resources>
<resource-root path="ojdbc6.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
In jboss-eap-6.1\standalone\configuration\standalone.xml
I added the following lines in the datasources
node:
<datasource jndi-name="java:/jdbc/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:@10.0.6.0:1521:ORC1;DB_CLOSE_DELAY=-1</connection-url>
<driver>oracle</driver>
<security>
<user-name>a</user-name>
<password>a</password>
</security>
</datasource>
<drivers>
<driver name="oracle" module="com.oracle.db">
<datasource-class>oracle.jdbc.driver.OracleDriver</datasource-class>
</driver>
</drivers>
And finally, in my Java code I create the connection with:
InitialContext initContext = new InitialContext();
DataSource ds = (DataSource)initContext.lookup("java:/jdbc/OracleDS");
conexion = ds.getConnection();
While executing this, it gives me an error on the line conexion = ds.getConnection()
:
javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jdbc/OracleDS
I've been looking for a possible solution on the net with no success. Any idea?