glassfish
  1. glassfish
  2. GLASSFISH-19362

system property created for other config will be set for DAS even though it shouldn't.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2, 3.1.2.2
    • Fix Version/s: 4.0_b64_EE7MS2
    • Component/s: configuration
    • Labels:
      None

      Description

      When a system property is create for other config, it is being set for the DAS as well, although domain.xml is updated correctly.

      Step to reproduce:
      %asadmin start-domain
      %asadmin deploy EnumProperties
      %asadmin create-instance --node localhost-domain1 test
      %asadmin start-instance test
      %asadmin create-system-properties --target test-config ATEST=atest-value

      you will see that domain.xml is updated correctly. ATEST is only showing up under <test-config>
      however, if you launch http://localhost:8080/EnumProperties
      you will see that ATEST is showing up too when it shouldn't.

      I see that in CombinedJavaConfigSystemPropertyListener.java, once it detected that the target is a config, it calls addToConfig
      else if (proxy instanceof Config)

      { return addToConfig(sp); }

      but addToConfig() doesn't test which config this is applying, and just call System.setProperty()

      private NotProcessed addToConfig(SystemProperty sp)

      { if (!serverHas(sp) && !clusterHas(sp)) System.setProperty(sp.getName(), sp.getValue()); //if server or cluster overrides it anyway, this should be a noop return null; //processed }

      I think that maybe the issue.

        Activity

        Hide
        Tom Mueller added a comment -

        Fixed on the trunk in revision 57081.

        This change fixes the CombinedJavaConfigSystemPropertyListener so that it only updates Java system property if the SystemProperty is for the current server/config/cluster.

        Show
        Tom Mueller added a comment - Fixed on the trunk in revision 57081. This change fixes the CombinedJavaConfigSystemPropertyListener so that it only updates Java system property if the SystemProperty is for the current server/config/cluster.
        Hide
        Tom Mueller added a comment -

        Backported to 3.1.2-SUSTAINING branch (revision 8351).

        Show
        Tom Mueller added a comment - Backported to 3.1.2-SUSTAINING branch (revision 8351).

          People

          • Assignee:
            Tom Mueller
            Reporter:
            Anissa Lam
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: