glassfish
  1. glassfish
  2. GLASSFISH-18597

system property substitution in admin-listener address causes instance to be unmanageable

    Details

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

      Description

      If the address field for the "admin-listener" network listener in an instance uses a system property substitution, then the instance cannot be managed by the DAS. For example, this configuration causes the problem:

      <config name="i1-config">
      ...
      <network-listener port="24848" protocol="pu-protocol" address="$

      {HTTP_LISTENER_ADDR}

      " transport="tcp" name="admin-listener" thread-pool="admin-thread-pool"></network-listener>

      </config>
      ...
      <server name="i1">
      <system-property name="HTTP_LISTENER_ADDR" value="myhost"/>
      </server>

      The problem with this is that when the DAS tries to obtain the hostname for accessing the instance, it looks up the address value from the network-listener named "admin-listener". However, it uses the value that has had system property substitution performed based on the DAS's system properties, not the server's system properties. So the DAS gets the wrong host value. This causes several problems:

      • start-instance cannot confirm that the instance has started, even though it has
      • list-instances will report wrong host values in its output and will say that the instance is down even though it is up
      • no command replication will work

      For the "port" value, the ServerHelper class uses special logic to perform system property substitution based on the server's values. This same logic is needed for the address attribute too.

        Activity

        Hide
        Byron Nevins added a comment -

        Notes to me:

        We probably should come up with an automatic way to do this for all such strings. This is pretty low-level and doesn't fix future such problems.
        Requires some investigation – why doesn't the core config code automatically translate properly?

        My wild-guess is that the translation code (and ultimately system props bootstrapping code) simply ignores the hierarchy of

        server-config/cluster-config/domain-config etc.

        Show
        Byron Nevins added a comment - Notes to me: We probably should come up with an automatic way to do this for all such strings. This is pretty low-level and doesn't fix future such problems. Requires some investigation – why doesn't the core config code automatically translate properly? My wild-guess is that the translation code (and ultimately system props bootstrapping code) simply ignores the hierarchy of server-config/cluster-config/domain-config etc.
        Hide
        Tom Mueller added a comment -

        Your wild guess is correct. TranslatedView just uses System.getProperty to resolve the values.

        Show
        Tom Mueller added a comment - Your wild guess is correct. TranslatedView just uses System.getProperty to resolve the values.
        Hide
        Byron Nevins added a comment -

        I checked-in to the branch first to do some testing. It will go into the trunk, verbatim, soon.

        d:\gf\branches\das-branch\nucleus\admin\config-api>svn commit
        Sending config-api\src\main\java\com\sun\enterprise\config\util\ServerHelper.java
        Transmitting file data .
        Committed revision 53372.

        Show
        Byron Nevins added a comment - I checked-in to the branch first to do some testing. It will go into the trunk, verbatim, soon. d:\gf\branches\das-branch\nucleus\admin\config-api>svn commit Sending config-api\src\main\java\com\sun\enterprise\config\util\ServerHelper.java Transmitting file data . Committed revision 53372.
        Hide
        Byron Nevins added a comment -

        committed into das branch and then merged into trunk.

        d:\gf\branches\das-branch\nucleus\admin\config-api\temp\config-api>svn commit
        Sending src\main\java\com\sun\enterprise\config\util\ServerHelper.java
        Transmitting file data .
        Committed revision 53376.

        branch:
        53372

        Show
        Byron Nevins added a comment - committed into das branch and then merged into trunk. d:\gf\branches\das-branch\nucleus\admin\config-api\temp\config-api>svn commit Sending src\main\java\com\sun\enterprise\config\util\ServerHelper.java Transmitting file data . Committed revision 53376. branch: 53372

          People

          • Assignee:
            Byron Nevins
            Reporter:
            Tom Mueller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: