8 Replies Latest reply on Jan 26, 2012 3:27 AM by vspadaro

    system property replacement doesn't work

    rhanus

      Hi,

       

      while migrating to jboss-7.0.2 I've find out that well-know replacement of system properties

      property=${other_property}

      is not supported

       

      standalone.xml like this:

      <server name="cartman" xmlns="urn:jboss:domain:1.0">

          <extensions>

           ...

          </extensions>

          <system-properties>

              <property name="my.project.dir" value="/home/cartman/jee6/migrate"/>

              <property name="my.project.temp.dir" value="${my.project.dir}/temp"/>

          </system-properties>

          ...

       

      results with property of my.project.temp.dir having value ${my.project.dir}/temp

        • 1. Re: system property replacement doesn't work
          rhanus

          while migrating to jboss-7.0.2 I've find out that well-know replacement of system properties

          property=${other_property}

          is not supported

          It should work since the replacement pattern is normally used in config files:

           

          <interfaces>   

               <interface name="management">       

                    <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>   

               </interface>   

               <interface name="public">       

                    <inet-address value="${jboss.bind.address:127.0.0.1}"/>   

               </interface>

          </interfaces>

          • 2. Re: system property replacement doesn't work
            rhanus

            doesn't work in persistence.xml:

             

            <?xml version="1.0" encoding="UTF-8"?>

            <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">

                <persistence-unit name="MyPU">

                  <jta-data-source>${my.db.name}</jta-data-source>

             

            ends up with:

             

            13:56:44,016 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Se

            rvices with missing/unavailable dependencies" => ["jboss.persistenceunit.\"new.ear/backend.jar#MyPU\" missing [ jboss.naming.context.java.\"${my.db.name}\" ]"]}}}

             

            corresponding JIRA issue

            • 3. Re: system property replacement doesn't work
              rhusar

              Hey Radim.

               

              The ${expressions} work only in places where they are supported by the parser and this is intentional. Not all attributes support this, more of them will be supported in 7.1 releases.

               

              Rado

              • 4. Re: system property replacement doesn't work
                rhanus

                Hi Rado,

                 

                have you got a list of supported descriptors where replacement should be supported in 7.1 ?

                as a side effect it's fine to know where it will not be supported -:)

                 

                Thanks,

                Radim

                • 5. Re: system property replacement doesn't work
                  rhusar

                  No, not really. But for sure, the values that already have an expression with default value will are supported already, for instance:

                   

                          <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
                          <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
                         <inet-address value="${jboss.bind.address:127.0.0.1}"/>
                      <socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
                      <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
                  • 6. Re: system property replacement doesn't work
                    stianst

                    Will this be supported in 7.1.0.Final?

                    • 7. Re: system property replacement doesn't work
                      vspadaro

                      I am migrating my application from jboss 6 to 7 and i have the same problem.

                       

                      It will be resolved in next release?

                      • 8. Re: system property replacement doesn't work
                        vspadaro

                        I made a temporary patch to resolve this issue

                         

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