Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-4801

When expression is used in jndi name attribute of datasource then test-connection-in-pool operation is not working

    Details

      Description

      Description of problem:
      ========================
      
      - Expression is added in the datasource JNDI name attribute as below:
      -----
        <datasource jndi-name="${ds}" pool-name="ExampleDS" enabled="true" use-java-context="true">
      -----
      
      - Value for the expression is passed to the JBoss server during the JBoss startup as below:
      -----
        ./standalone.sh -Dds=java:jboss/datasources/ExampleDS
      -----
      
      - In the server.log file below is the information regarding the datasource.
      -----
        INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [${ds}]
      ----- 
      
      - Test the datasource using the below command and here is the result:
      ----
      [standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS:test-connection-in-pool()
      {
          "outcome" => "failed",
          "failure-description" => "JBAS010440: failed to invoke operation: JBAS010442: failed to match pool. Check JndiName: java:/${ds}",
          "rolled-back" => true
      }
      ----
      
      - Here is the information regarding the JNDI name attribute:
      ----
      [standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS:read-resource-description(recursive=true)
      {
          "outcome" => "success",
          "result" => {
              	  :
                  "jndi-name" => {
                      "type" => STRING,
                      "description" => "Specifies the JNDI name for the datasource",
                      "expressions-allowed" => true,
                      "nillable" => false,
                      "access-type" => "read-write",
                      "storage" => "configuration",
                      "restart-required" => "no-services"
                  },
      		  :
      }
      -----
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                soul2zimate Chao Wang
                Reporter:
                soul2zimate Chao Wang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: