user260495
user260495

Reputation: 127

Unable to add driver in Jboss EAP 7.1 server

I am following the documentation here for creating datasources in JBoss EAP 7.1 JBoss 7.1 doc but it fails at the driver creation stage. I am just running a standalone application.

I have seen the answers here Answer 1 and here Answer 2]3 but they don't help, at least after reading them I still don't know what the issue is. First I have added a module for oracle jdbc file adding an xml definition and jar file to module/com/oracle/jdbc/main - this works. I then try to add the driver using the cli and get an error. My command is :

/subsystem=datasource/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=com.oracle.jdbc,driver-class-name=oracle.jdbc.driver.OracleDriver)

The error is

Failed to get the list of the operation properties: "WFLYCTL0030: No resource definition is registered for address [
    ("subsystem" => "datasource"),
    ("jdbc-driver" => "oracle")

I also tried using the admin gui and get the following response

Internal Server Error
    {
        "outcome" => "failed",
        "failure-description" => {
            "WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.oracle"],
            "WFLYCTL0180: Services with missing/unavailable dependencies" => [
                "jboss.driver-demander.java:/jdbc/access is missing [jboss.jdbc-driver.oracle]",
                "org.wildfly.data-source.jdbc/access is missing [jboss.jdbc-driver.oracle]"
            ]
        },
        "rolled-back" => true
    }

I don't want to edit xml directly so would want to get one of these two approaches working. Any help appreciated!


Edit

Adding module xml :

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

Upvotes: 1

Views: 3855

Answers (1)

Sweta Patra
Sweta Patra

Reputation: 351

Try creating the module via CLI directly,module.xml is different from what should be created.

[JBOSS_bin]$ ./jboss-cli.sh 
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] module add --name=com.oracle --resources=/home/jdbc_test/ojdbc6-11.2.0.3.jar  --dependencies=javax.api,javax.transaction.api
[disconnected /] connect
[standalone@localhost:9990 /] /subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=com.oracle)
    {"outcome" => "success"}
[standalone@localhost:9990 /]

Upvotes: 1

Related Questions