Datasource pool test-connection failing for new datasource (prior to JVM restart) in JBoss EAP

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Issue

  • Trying to create datasource and JNDI to connect mysql DB with admin console in domain controller environment, but it throws error as below. We are sure all the DB configuration is correct:
Unexpected HTTP response: 500

Request
{
    "password" => "test",
    "enabled" => false,
    "driver-name" => "mysql-connector-java-5.1.31-bin.jarcom.mysql.jdbc.Driver_5_1",
    "user-name" => "test",
    "jta" => false,
    "use-ccm" => false,
    "pool-name" => "test_Pool",
    "set-tx-query-timeout" => false,
    "query-timeout" => 0L,
    "allocation-retry" => 0,
    "allocation-retry-wait-millis" => 0L,
    "connection-url" => "jdbc:mysql://localhost:3307/testdb",
    "driver-class" => "com.mysql.jdbc.Driver",
    "share-prepared-statements" => false,
    "use-try-lock" => 0L,
    "blocking-timeout-wait-millis" => 0L,
    "idle-timeout-minutes" => 0L,
    "background-validation" => false,
    "validate-on-match" => false,
    "jndi-name" => "java:/test",
    "name" => "test",
    "operation" => "add",
    "address" => [
        ("profile" => "full"),
        ("subsystem" => "datasources"),
        ("data-source" => "leadsDS")
    ]
}

Response

Internal Server Error
{
    "outcome" => "failed",
    "result" => undefined,
    "failure-description" => "JBAS010839: Operation failed or was rolled back on all servers.",
    "rolled-back" => true,
    "server-groups" => {
        "One-Group" => {"host" => {"One-host" => {"One-Server" => {"response" => {
            "outcome" => "failed",
            "result" => undefined,
            "rolled-back" => true
        }}}}},
        "Two-GROUP" => {"host" => {"Two-host" => {"Two-Server" => {"response" => {
            "outcome" => "failed",
            "result" => undefined,
            "rolled-back" => true
        }}}}},
        "Third-GROUP" => {"host" => {"third-host" => {"Third-Server" => {"response" => {
            "outcome" => "failed",
            "result" => undefined,
            "failure-description" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.driver-demander.java:/test is missing [jboss.jdbc-driver.mysql-connector-java-5_1_31-bin_jarcom_mysql_jdbc_Driver_5_1]"]},
            "response-headers" => {"process-state" => "restart-required"},
            "rolled-back" => true
        }}}}}
    }
}

Resolution

  • If any server is in "process-state" => "restart-required", then the datasource addition or its test-connection operation will not be successful on the profile which is being used by that server, until the server is not restarted.
  • In this case restarting the Third-Server should solve the above mentioned issue.
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.