3 Replies Latest reply on Aug 4, 2012 9:04 AM by xiang yingbing

    System Property reference does NOT work in ""?

    xiang yingbing Master

      Dear all,

       

       

          I defined my System properties:

       

      <?xml version='1.0' encoding='UTF-8'?>
      
      <server xmlns="urn:jboss:domain:1.2">
      
          <extensions>
              ...
          </extensions>
      
          <system-properties>
              <property name="nms.system.property.datasource.jndi-name" value="java:jboss/datasources/NmsMySqlDS"/>
              <property name="nms.system.property.datasource.connection-url" value="jdbc:mysql://localhost:3306/nms"/>
              ...
          </system-properties>
      

       

      and datasource


      <datasource jndi-name="java:jboss/datasources/NmsMySqlDS" pool-name="MySqlDS">

      <connection-url>${nms.system.property.datasource.connection-url}</connection-url>

      <driver>com.mysql</driver>

      ...

      </datasource>

       

       

       

      Now, everything works well

       

       

      But after I changed datasource definition to

       


      <datasource jndi-name="${nms.system.property.datasource.jndi-name}" pool-name="MySqlDS">

      <connection-url>${nms.system.property.datasource.connection-url}</connection-url>

      <driver>com.mysql</driver>

      ...

      </datasource>

       

      I got bellow exception

      10:07:18,015 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite oper
      ation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unav
      ailable dependencies" => ["jboss.persistenceunit.\"nms-server-ear.ear/nms-server-ejb.jar#nms-server\"jboss.naming.contex
      t.java.jboss.datasources.NmsMySqlDSMissing[jboss.persistenceunit.\"nms-server-ear.ear/nms-server-ejb.jar#nms-server\"jbo
      ss.naming.context.java.jboss.datasources.NmsMySqlDS]"]}}}
      

       

       

      Obviosly, the datasource jndi name is NOT translated!!!

       

       

       

       

       

      I found that <login-module> has the same issue:

                          <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
                              <module-option name="password-stacking" value="useFirstPass"/>
                              <module-option name="dsJndiName" value="java:jboss/datasources/NmsMySqlDS"/>
                              <module-option name="principalsQuery" value="SELECT passwdHash FROM testuser WHERE name=?"/>
                              <module-option name="rolesQuery" value="SELECT r.name, 'Roles' FROM testroles r, testuser u where u.id=r.user_id and u.name=?"/>
                              <module-option name="hashAlgorithm" value="SHA-256"/>
                              <module-option name="hashEncoding" value="Base64"/>
                              <module-option name="hashCharset" value="UTF-8"/>
                              <module-option name="unauthenticatedIdentity" value="guest"/>
                          </login-module>

      Namely, I can NOT change

      <module-option name="dsJndiName" value="java:jboss/datasources/NmsMySqlDS"/>

      to

      <module-option name="dsJndiName" value="${nms.system.property.datasource.jndi-name}"/>

       

       

       

       

      Is my configuration wrong?