8

I'm using wildfly-10.1.0.Final and I'm trying to add an oracle Datasource:

<datasource jndi-name="java:jboss/datasources/OracleDS" pool-name="OracleDS" enabled="true">
                <connection-url>jdbc:oracle:thin:@localhost:1523/pdborcl</connection-url>
                <driver>oracle</driver>
                <pool>
                    <min-pool-size>1</min-pool-size>
                    <max-pool-size>5</max-pool-size>
                    <prefill>true</prefill>
                </pool>
                <security>
                    <user-name>admin</user-name>
                    <password>admin</password>
                </security>
            </datasource>

And the driver:

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

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

<module xmlns="urn:jboss:module:1.1" name="com.oracle.ojdbc">
  <resources>
    <resource-root path="ojdbc7.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
  </dependencies>
</module>

But when I start the server I get:

11:14:30,226 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "OracleDS")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.oracle"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "org.wildfly.data-source.OracleDS is missing [jboss.jdbc-driver.oracle]",
        "jboss.driver-demander.java:jboss/datasources/OracleDS is missing [jboss.jdbc-driver.oracle]"
    ]
}
11:14:30,228 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "OracleDS")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => [
        "jboss.jdbc-driver.oracle",
        "jboss.jdbc-driver.oracle"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "org.wildfly.data-source.OracleDS is missing [jboss.jdbc-driver.oracle]",
        "jboss.driver-demander.java:jboss/datasources/OracleDS is missing [jboss.jdbc-driver.oracle]",
        "org.wildfly.data-source.OracleDS is missing [jboss.jdbc-driver.oracle]"
    ]

I already read all the similar threads, including this one: Unable to define oracle datasource on Jboss AS 7. But, I couldn't seem to find the solution.

Community
  • 1
  • 1
Ena Jovicic
  • 101
  • 1
  • 1
  • 5
  • 1
    Have you figured this out? I seem to have the same problem... – Voooza Dec 12 '16 at 11:35
  • Ok I think I did with help of: http://stackoverflow.com/questions/35371584/wildfly-failed-to-load-module-for-oracle-driver – Voooza Dec 12 '16 at 12:19
  • Sometimes you need restart server to take an effect. – Michal Sipek Dec 28 '16 at 11:42
  • For me it´s not working either. I´ve a running module for MySQL and Oracle under Wildfly 8.2 - now I wanted to start with wildfly 10 but the modules are not recognized. In wildfly 8 the server says on startup "JBAS010417: Started Driver service with driver-name = oracle" - on wildfly 10 I only get the "h2" driver. – cljk Mar 17 '17 at 07:11
  • BTW Since I made ~3 wildfly 8 running with MySQL/Oracle-Driver - the modules have to be okay. I only copied the modules to wildfly 10 so they *should* work there too. The documentation says nothing different. Currently I believe it´s a bug. – cljk Mar 17 '17 at 07:14
  • Did you solve your problem, I'm using wildfly-17.0.1 and I'm having the same problem – khouloud Jun 17 '20 at 15:11

2 Answers2

1

Another way to do that:

Log on WildFly CLI

./jboss-cli.sh -c

Deploy the Oracle JDBC Driver

deploy /path_to_the_file/ojdbc7.jar

Creates a JDBC Data Source with one Connection Pool Configured

data-source add \
--name=MyOracleDataSource \
--jndi-name=java:/datasources/MyOracleDataSource \ 
--driver-name=ojdbc7.jar \ 
--driver-class=oracle.jdbc.OracleDriver \ 
--connection-url=jdbc:oracle:thin:@ORACLE_SERVER_NAME:1521/ORACLE_SERVICE_NAME \ 
--user-name=ORACLE_USER_NAME \ 
--password=ORACLE_USER_PASSWORD \ 
--allocation-retry=3 \ 
--background-validation=true \ 
--background-validation-millis=60000 \ 
--capacity-incrementer-class=org.jboss.jca.core.connectionmanager.pool.capacity.WatermarkIncrementer \ 
--capacity-decrementer-class=org.jboss.jca.core.connectionmanager.pool.capacity.WatermarkDecrementer \ 
--check-valid-connection-sql='SELECT 1 FROM dual' \ 
--connectable=false \ 
--enlistment-trace=true \ 
--exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter \ 
--flush-strategy=EntirePool \ 
--jta=true \ 
--initial-pool-size=2 \ 
--min-pool-size=2 \ 
--max-pool-size=5 \ 
--mcp=org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool \ 
--pool-prefill=true \ 
--pool-use-strict-min=true \ 
--set-tx-query-timeout=false \ 
--share-prepared-statements=false \ 
--spy=false \ 
--stale-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker \ 
--statistics-enabled=true \ 
--track-statements=NOWARN \ 
--tracking=false \ 
--use-ccm=true \ 
--use-fast-fail=false \ 
--use-java-context=true \ 
--valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker \ 
--enabled=true
Silvio Silva
  • 31
  • 1
  • 6
0

As stated in my comment above I had and have the same problem - my driver-modules working on Wildfly 8 were not working under wildfly 10.

I now have a workaround(/solution?) - see https://docs.jboss.org/author/display/WFLY10/DataSource+configuration :

I simply deployed the ojdbc7.jar like I would do with an EAR or WAR (used the admin frontend http://localhost:9990).

My server then recognized the driver

WFLYJCA0004: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 12.1) Started Driver service with driver-name = ojdbc7-12.1.0.1.jar

and I could define a Non-XA datasource (Configuration -> Subsystems -> Datasources) and it worked. I really don´t know if this deployment has any drawbacks. But my arquillian test cases seem to work.

In wildfly 10 I don´t see any possibilities to edit my existing datasource and the server asks me to restart on every configuration change.... Even configuration options for validating the connection etc. are missing in admin gui?!

cljk
  • 936
  • 1
  • 7
  • 20
  • 1
    Also got my module working now. I had to add it to the configuration (standalone.xml): [...] oracle.jdbc.xa.client.OracleXADataSource – cljk Mar 17 '17 at 07:53