1 Reply Latest reply on Aug 4, 2011 3:16 PM by shelleyb

    Oracle datasource problem

    herb

      I'm stuck creating an Oralce datasource in AS 7 CR1.

       

      I found http://community.jboss.org/wiki/DataSourceConfigurationinAS7 and tried to follow these instructions, but it doesn't work for me...

       

      What I've done:

       

      I decided to use "JDBC driver as deployment" (and NOT "as module").

      I copied Oracle JDBC driver (ojdbc6-11.2.0.2.0.jar and orai18n-11.2.0.2.0.jar) to <as7>/standalone/deployments

       

      log says:

           [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "orai18n-11.2.0.2.0.jar"

           [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "ojdbc6-11.2.0.2.0.jar"

           [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "orai18n-11.2.0.2.0.jar"

           [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "ojdbc6-11.2.0.2.0.jar"

      which seems ok to me

       

      I added following to standalone.xml:

      <datasource jndi-name="java:jboss/datasources/oracleDS" pool-name="OracleDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">

          <connection-url>jdbc:oracle:thin:@xxxx:1521:yyyy</connection-url>

          <!--<driver-class>oracle.jdbc.OracleDriver</driver-class>-->

          <driver>oracle</driver>

          <pool><prefill>true</prefill><use-strict-min>false</use-strict-min>

              <flush-strategy>FailingConnectionOnly</flush-strategy>

          </pool>

          <security><user-name>aaaa</user-name><password>bbbb</password></security>

          <validation><validate-on-match>false</validate-on-match>

              <background-validation>false</background-validation>

              <useFastFail>false</useFastFail>

          </validation>

      </datasource>

      ...

      <driver name="oracle" module="oracle.jdbc">

        <xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class>

      </driver>

       

      Deploying a war which references the datasource in persistence.xml I get following error:

      ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"test.jboss7.jpa.war\".component.\"org.jboss.as.weld.webtier.jsp.JspInitializationListener\".START","jboss.web.\"test.jboss7.jpa.war\"","jboss.persistenceunit.\"test.jboss7.jpa.war#primary\""]}}}

       

      Is the <driver> section correct?

      Why do I have to specify a "module" in the <driver> section? - Above I decided to use "JDBC driver as deployment" and NOT "as module" - so I did not create a module?!

      I also tried with and without "<driver-class>".

       

      What seems curious to me is, that in the log the loading of the jdbc driver is done AFTER the attempt to initialise the datasource:

      13:57:59,740 INFO  [org.jboss.as.controller] (Controller Boot Thread) Service status report

         New missing/unsatisfied dependencies:

            service jboss.jdbc-driver.oracle_jdbc (missing)

      ...

      13:57:59,755 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "ojdbc6-11.2.0.2.0.jar"

      13:57:59,755 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "orai18n-11.2.0.2.0.jar"

      13:58:00,068 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)

       

      What I'm doing wrong?