glassfish
  1. glassfish
  2. GLASSFISH-21584

A new property cannot be added in "Cluster System Properties" page.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1, 5.0
    • Fix Version/s: 5.0
    • Component/s: admin_gui
    • Labels:
      None

      Description

      A new property cannot be added in "Cluster System Properties" page.

      Steps to reproduce:
      1. Open Admin Console
      2. Create a new cluster, e.g. cluster1
      3. Click on "cluster1" (to go to "General Information" page) then click on the "Properties" tab (to get to the "Cluster System Properties" page).
      4. Click on "Add Property" and enter "myprop" for the Instance Variable Name and "123" for the Override Value, then hit the "Save" button.

      => Page displays message "New values successfully saved." however the table now DOES NOT contain the newly added property.

      If the domain.xml is checked, the newly added property has NOT been added to the file.
      Below shows where it SHOULD HAVE been added to the file:

      <domain>
      <clusters>

      <cluster ... name="cluster1" ... >

      <system-property name="myprop" value="123"></system-property>

      We further observe that adding a property with the same name as an existing one or adding a property with no name specified, does not result in any error when the "Save" button is hit (in addition to the fact that the newly added properties are discarded).

      Cause:
      System properties may be specified for "server" and for cluster instances, using a very similar page.
      To see this page for server, click on "server" in the navigation tree, to go to its "General Information" page, then click on the "Properties" tab ("System Properties" page).
      To see this page for cluster instances, create a cluster instance, click on the link for it, to go to its "General Information" page, then click on the "Properties" tab ("Instance System Properties" page).
      These pages properly support adding new properties, and properly validate the properties (checks for duplicate properties and those with no name specified etc.)

      The JSF files which specify the "Save" button actions for Cluster System Properties and Server/Instance System Properties are (respectively):

      main\appserver\admingui\cluster\src\main\resources\cluster\clusterSystemPropertiesButtons.jsf

      main\appserver\admingui\common\src\main\resources\configuration\systemPropertiesButtons.jsf

      If we compare these files, it is apparent that the "clusterSystemPropertiesButtons.jsf" has the following problems:

      • the wrong table column name is being used for the property value (using "row.value" instead of "row.overrideValue")
      • the wrong parameter name for the property map is being used in the gf.restRequest() invocation ("data" instead of "attrs")

      Fix:
      The following change fixes this bug. "main\appserver\admingui\cluster\src\main\resources\cluster\clusterSystemPropertiesButtons.jsf"

      Index: clusterSystemPropertiesButtons.jsf
      ===================================================================
      --- clusterSystemPropertiesButtons.jsf	(revision 64342)
      +++ clusterSystemPropertiesButtons.jsf	(working copy)
      @@ -44,9 +44,9 @@
               gf.isClusterName(clusterName="#{pageSession.clusterName}" );
               createMap(result="#{requestScope.data}");
               foreach (var="row" list="#{pageSession.tableList}") {
      -            mapPut(map="#{requestScope.data}", key="#{row.name}", value="#{row.value}");
      +            mapPut(map="#{requestScope.data}", key="#{row.name}", value="#{row.overrideValue}");
               }
      -        gf.restRequest(endpoint="#{pageSession.selfUrl}", method="POST", data="#{requestScope.data}", contentType="application/x-www-form-urlencoded", result="#{requestScope.restResponse}");
      +        gf.restRequest(endpoint="#{pageSession.selfUrl}", method="POST", attrs="#{requestScope.data}", contentType="application/x-www-form-urlencoded", result="#{requestScope.restResponse}");
               prepareSuccessfulMsg();
               gf.redirect(page="#{pageSession.selfPage}&alertType=${alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}");
               />
      

        Activity

        Hide
        pranjal.sahay added a comment -

        Fixed by r64409

        Show
        pranjal.sahay added a comment - Fixed by r64409

          People

          • Assignee:
            pranjal.sahay
            Reporter:
            tak09
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: