Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-5343

SAR MBean attribute whose string attribute uses ${} are not replaced with sysprop values

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • JMX

      See the attached .sar as a test to replicate this - just deploy it in a 7.1.1.Final standalone/deployments directory and run it as explained below.

      This SAR has a String attribute. Its value is made up of some ${x} with some static text:

      <attribute name="MyStr">my.sys.prop=${my.sys.prop} jboss.home.dir=${jboss.home.dir} java.version=${java.version}</attribute>

      Start the AS7 server with the cmd line option "-Dmy.sys.prop=boo" (I also tried this with my.sys.prop=boo in a "my.properties" file and I passed in "-P my.properties" - same problem happens).

      When you look in the logs, the MBean will print out the value it gets in its setting method:

      15:19:41,448 INFO [stdout] (MSC service thread 1-5) STR attribute being set to=my.sys.prop=${my.sys.prop} jboss.home.dir=${jboss.home.dir} java.version=${java.version}

      Notice none of the ${x} tokens are replaced. Not even the JVM sysprop "java.version" - nor the JBoss "jboss.home.dir" - nor the one I passed into AS7 (my.sys.prop).

        1. test.sar
          3 kB
          John Mazzitelli

              emartins@redhat.com Eduardo Martins
              jmazzitelli John Mazzitelli
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: