Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to define oracle datasource on Jboss AS 7

I'm using Jboss AS 7.1.1.final and I'm trying to add an oracle Datasource:

<datasource jndi-name="java:jboss/datasources/DefaultDS" 
            pool-name="DefaultDS" 
            enabled="true" 
            use-java-context="true">
    <connection-url>jdbc:oracle:oci@TNS_NAME</connection-url>
    <driver>oracle</driver>
    <security>
        <user-name>username</user-name>
        <password>pwd</password>
    </security>
</datasource>

And the driver:

<driver name="oracle" module="com.oracle.ojdbc">
   <xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class>
</driver>

But when I start the server I get:

JBAS014775:    New missing/unsatisfied dependencies:
  service jboss.jdbc-driver.oracle (missing) dependents: [service jboss.data-source.java:jboss/datasources/DefaultDS] 

I have a module under modules/com/oracle/ojdbc/main:

<module xmlns="urn:jboss:module:1.0" name="com.Oracle.ojdbc">
    <resources>
        <resource-root path="ojdbc6.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
    </dependencies>
</module>

and of course the jar is there.

Can someone please tell me what am I doing wrong here?

like image 522
Tomer Avatar asked Apr 11 '12 08:04

Tomer


People also ask

How do I add Datasource to WildFly?

Creating a Datasource for WildFly 9 is a pretty simple task thanks to the templating wizard that is included on the Web console. Next, you have to bind the Datasource to a Driver. In the default settings the application server propose you the com. oracle Module name.


1 Answers

Add this to define driver: for xa datasource

<driver name="oracleDriver" module="com.oracle.ojdbc">
         <driver-class>oracle.jdbc.OracleDriver</driver-class>
         <xa-datasource-class>oracle.jdbc.xa.OracleXADataSource</xa-datasource-class>
</driver>

for non-xa-------

<driver name="oracleDriver" module="com.oracle.ojdbc">
         <driver-class>oracle.jdbc.OracleDriver</driver-class>
    </driver>
like image 161
Ajitesh Sinha Avatar answered Sep 20 '22 11:09

Ajitesh Sinha