4 Replies Latest reply on May 29, 2017 10:46 AM by Anup Dey

    Failed to create JDBC connection for jboss EAP 7

    Hemaananthi Hemaananthi Newbie

      configured the non-xa datasources for Oracle RAC 12c

      Connection URL:

      jdbc:oracle:thin:@MCPHOST01-scan.sccb.local:1545:SITTEST.sccb.local

       

      module.xml file:

      <?xml version="1.0" ?>

      <module xmlns="urn:jboss:module:1.1" name="com.oracle">

          <resources>

              <resource-root path="ojdbc6.jar"/>

          </resources>

          <dependencies>

              <module name="javax.api"/>

          </dependencies>

      </module>

       

       

      Error messages are:

       

      Unexpected HTTP response: 500

       

      Request

      {

        "address" => [],

        "operation" => "composite",

        "steps" => [

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app1-host"),

        ("server" => "app1-1"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        },

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app1-host"),

        ("server" => "app1-2"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        },

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app1-host"),

        ("server" => "app1-3"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        },

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app1-host"),

        ("server" => "app1-4"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        },

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app1-host"),

        ("server" => "app1-5"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        },

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app2-host"),

        ("server" => "app2-1"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        },

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app2-host"),

        ("server" => "app2-2"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        },

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app2-host"),

        ("server" => "app2-3"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        },

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app2-host"),

        ("server" => "app2-4"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        },

        {

        "operation" => "test-connection-in-pool",

        "address" => [

        ("host" => "app2-host"),

        ("server" => "app2-5"),

        ("subsystem" => "datasources"),

        ("data-source" => "SITTEST")

        ]

        }

        ]

      }

       

      Response

       

      Internal Server Error

      {

        "outcome" => "failed",

        "result" => {

        "step-1" => {

        "outcome" => "failed",

        "result" => undefined,

        "failure-description" => "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid",

        "rolled-back" => true

        },

        "step-2" => {"outcome" => undefined},

        "step-3" => {"outcome" => undefined},

        "step-4" => {"outcome" => undefined},

        "step-5" => {"outcome" => undefined},

        "step-6" => {"outcome" => undefined},

        "step-7" => {"outcome" => undefined},

        "step-8" => {"outcome" => undefined},

        "step-9" => {"outcome" => undefined},

        "step-10" => {"outcome" => undefined}

        },

        "failure-description" => {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid"}},

        "rolled-back" => true

      }

       

       

      command line error:

       

      [Server:app1-1]         at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$1.run(TransactionalProtocolOperationHandler.java:138)

      [Server:app1-1]         at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$1.run(TransactionalProtocolOperationHandler.java:134)

      [Server:app1-1]         at java.security.AccessController.doPrivileged(Native Method)

      [Server:app1-1]         at javax.security.auth.Subject.doAs(Subject.java:360)

      [Server:app1-1]         at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:81)

      [Server:app1-1]         at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2$1.run(TransactionalProtocolOperationHandler.java:157)

      [Server:app1-1]         at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2$1.run(TransactionalProtocolOperationHandler.java:153)

      [Server:app1-1]         at java.security.AccessController.doPrivileged(Native Method)

      [Server:app1-1]         at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2.execute(TransactionalProtocolOperationHandler.java:153)

      [Server:app1-1]         at org.jboss.as.protocol.mgmt.AbstractMessageHandler$ManagementRequestContextImpl$1.doExecute(AbstractMessageHandler.java:363)

      [Server:app1-1]         at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:472)

      [Server:app1-1]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

      [Server:app1-1]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

      [Server:app1-1]         at java.lang.Thread.run(Thread.java:745)

      [Server:app1-1]         at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      [Server:app1-1] Caused by: java.sql.SQLException: Listener refused the connection with the following error:

      [Server:app1-1] ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

      [Server:app1-1]

      [Server:app1-1]         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:743)

      [Server:app1-1]         at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:662)

      [Server:app1-1]         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)

      [Server:app1-1]         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:560)

      [Server:app1-1]         at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:321)

      [Server:app1-1]         ... 31 more

      [Server:app1-1] Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:

      [Server:app1-1] ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

      [Server:app1-1]

      [Server:app1-1]         at oracle.net.ns.NSProtocolStream.negotiateConnection(NSProtocolStream.java:275)

      [Server:app1-1]         at oracle.net.ns.NSProtocol.connect(NSProtocol.java:264)

      [Server:app1-1]         at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1452)

      [Server:app1-1]         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:496)

      [Server:app1-1]         ... 35 more

      [Server:app1-1]

      [Server:app1-1] 20:25:04,181 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 76) WFLYCTL0013: Operation ("test-connection-in-pool") failed - address: ([

      [Server:app1-1]     ("subsystem" => "datasources"),

      [Server:app1-1]     ("data-source" => "SCCBDB")

      [Server:app1-1] ]) - failure description: "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid"

        • 1. Re: Failed to create JDBC connection for jboss EAP 7
          nurubhas s Newbie

          Hi ,

           

          Based on error message... you have to check two things.

           

          Error Message :

           

          [Server:app1-1] Caused by: java.sql.SQLException: Listener refused the connection with the following error: ( Check Network , Firewall )

           

          First check the connectivity between the Jboss Host machine & DB server ( seems to be you have used scan name.. instead of Host).

           

          you can do telnet from Jboss Host with DB port

           

          telnet MCPHOST01-scan.sccb.local 1545

           

           

          [Server:app1-1] ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

           

          If it is connected... you can ask the DB team to check the wether the configured SID is exists or not ( reason is.. if it SITTEST.sccb.local not available in DB... you will get the same error) Check the correct SID.

           

           

          before configure .

           

          Thanks

          Nurubhas

           

          • 2. Re: Failed to create JDBC connection for jboss EAP 7
            Anup Dey Apprentice
            The error you are getting is originating from the Oracle jdbc driver. JBoss catches and simply reports the error thrown by the driver. 

            The above may indicate that the database server is not able to accept any traffic. Since this seems to be an issue in the database server itself, Wildfly do nothing more than report the error. At some point (when the database was again available) you should have seen new connections become possible.

             

            - Need to verify the database is running correctly at the specified destination

             

            - Verify the connection properties.

             

            - Make sure that an instance of Oracle Server is running on the host and accepting TCP/IP connections at the port.

             

            - Make sure that TCP connections to the port are not blocked by a firewall.

             

            - This is a generic network issue where the other side of the connection has closed the connection. This could be happening due to firewalls, switches on the network or the actual back-end server (in this case the Oracle server)

             

            - This is not a JBoss issue, but should be investigated by:

              - network administrators

              - back-end server administrators (in this case Oracle admins)

             

            - The error that you see signifies that the Oracle driver is unable to make a connection to the database, and it is timing out. This is usually a network issue.

             

            - The fact that restarting JBoss might fix the connections suggests that you may have invalid connections left in your pool after the network issue.

             

            - You can also check your database connectivity is properly established between your application and database

             

            - Test the network with the usual means like ping, telnet, ssh... connection tests.

             

            - You might like to check with your DBA to check what actually went wrong during that time stamp.

            • 3. Re: Failed to create JDBC connection for jboss EAP 7
              Hemaananthi Hemaananthi Newbie

              Hi Anup,

               

                  Thanks a lot for your help. I can able to do telnet, ping, ssh everything ok from app to DB.

                  we have installed the SQL client in app server and done the tnsping, it was success.

                  there is no problem with firewall from app to db and db to app

               

               

              give me the syntax for JNDI

               

              for me I am given:

               

              java:jboss/datasources/htest

              • 4. Re: Failed to create JDBC connection for jboss EAP 7
                Anup Dey Apprentice

                JNDI name for datasource can be configured using java:/xxxx or java:jboss/xxxx.

                The above two JNDI names are supported for datasource in JBoss EAP 6.

                Using the JNDI name java:jboss/xxxx for datasource is the preferred way.