Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1325

String property replacement is not working for constructors.

XMLWordPrintable

      In the following sample of an MBean the StringPropertyReplacer is not applied for the
      values needed in the constructor.

      <mbean code="org.jboss.security.plugins.JaasSecurityDomain"
      name="jboss.security:service=JaasSecurityDomain,domain=RMI+SSL">
      <constructor>
      <arg type="java.lang.String" value="${my.domain.name}" />
      </constructor>
      <attribute name="KeyStoreURL">myKeys.ks</attribute>
      <attribute name="KeyStorePass">tryIt</attribute>
      </mbean>

      In this sample JaasSecurityDomain would be creaded with "${my.domain.name}" as argument
      instead of the corresponding SystemProperty.

      The fix is very simple:

      in org.jboss.system.ServiceCreator.ConstructorInfo#create (around line 287):
      Element arg = (Element)list.item(j);
      // String signature = arg.getAttribute("type");
      String signature = StringPropertyReplacer.replaceProperties(arg.getAttribute("type"));
      // String value = arg.getAttribute("value");
      String value = StringPropertyReplacer.replaceProperties(arg.getAttribute("value"));
      Object realValue = value;

              starksm64 Scott Stark (Inactive)
              wv-javacoder Roland Räz (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 5 minutes
                  5m
                  Remaining:
                  Remaining Estimate - 5 minutes
                  5m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified