WildFly jdbc connection with Oracle

22,175

This kind of failures are sometimes difficult to fix, because are exceptions from the own server. However check this, check your invalid jndiName in your code.

https://issues.jboss.org/browse/AS7-2199

Share:
22,175
Admin
Author by

Admin

Updated on July 07, 2020

Comments

  • Admin
    Admin almost 4 years

    I try to create jdbc connection. I use WildFly Application Server
    9.0.0.CR1 and oracle 11g. I put ojdbc14 and created module.xml in the folder C:\wildfly-9.0.0.CR1\modules\com\oracle\ojdbc14\main:

    <?xml version="1.0" encoding="UTF-8"?> 
    <module xmlns=xm lns="urn:jboss:module:1.0"" name="com.oracle.ojdbc14"> 
    <resources> 
    <resource-root path="ojdbc14.jar"/> 
    </resources> 
    <dependencies> 
    <module name="javax.api"/> 
    </dependencies> 
    </module>
    

    and inserted to the standalone.xml:

    <subsystem xmlns="urn:jboss:domain:datasources:1.0">     
                <datasources>
                 <datasource jndi-name="java:jboss/datasources/accounting" pool-name="OracleDS" enabled="true" use-java-context="true"> 
                    <connection-url>jdbc:oracle:thin:@cmx-itm-03:1521/COREJAVA</connection-url> 
                    <driver-class>oracle.jdbc.OracleDriver</driver-class> 
                    <driver>oracle</driver> 
                    <security> 
                    <user-name>Java_Learning</user-name> 
                    <password>Qazxsw123</password> 
                    </security> 
                </datasource> 
                <drivers>
                    <driver name="oracle" module="com.oracle.ojdbc14"/> 
                </drivers>
                </datasources>
            </subsystem>
    

    So, I got the error when try test connection from console:

    Unexpected HTTP response: 500
    
    Request
    {
        "address" => [
            ("subsystem" => "datasources"),
            ("data-source" => "OracleDS")
        ],
        "operation" => "test-connection-in-pool"
    }
    
    Response
    
    Internal Server Error
    {
        "outcome" => "failed",
        "failure-description" => "WFLYJCA0040: failed to invoke operation: WFLYJCA0042: failed to match pool. Check JndiName: java:jboss/datasources/accounting",
        "rolled-back" => true
    }
    

    I googled it and tried all that I found but still have this error. Please, help me.