glassfish
  1. glassfish
  2. GLASSFISH-15050

RuntimeException Thrown when Logger Settings/General Page is edited and Saved in a new config

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1_b31
    • Fix Version/s: 3.1_b38
    • Component/s: logging
    • Labels:
      None
    • Environment:

      OS: Soalris Sparc 10
      Browser: firefox 3.6

      Description

      Build used : GF nightly dated 12/08

      Create a new configuration by copying from default-config.
      In the newconfig/Logger Settings/General Page, Edit some fields, and/or enable "Write to System log" checkbox, or" Log ot Console" checkbox and click "Save" button. See that in the console window, "java.lang.RuntimeException" is thrown.

      This happens only in a new conffig. In the server-config the changes get saved successfully.

      In the server.log, the below Exception is seen:

      [#|2010-12-08T14:17:53.937-0800|SEVERE|oracle-glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=15;_ThreadName=Thread-1;|javax.faces.FacesException: java.lang.reflect.InvocationTargetException while attempting to process a 'command' event for 'saveButton'.
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:89)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:395)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
      at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:233)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:600)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:228)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:817)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:718)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1007)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      @ at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'command' event for 'saveButton'.
      at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:422)
      at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:394)
      at com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:150)
      at com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:98)
      at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
      at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
      at javax.faces.component.UICommand.broadcast(UICommand.java:300)
      at com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:166)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
      ... 33 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:442)
      at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:420)
      ... 43 more

        Activity

        Hide
        sirajg added a comment -

        I cannot reproduce it with b31 or the current build. I created a new config, made modifications to the logger settings and clicked Save. I tried with a config associated with and instance and without an instance. It worked in both the cases. There was an issue in logging backend earlier which would have produced similar result. Don't have that issue number.

        Closing as not reproducible. Reopen with more details if it is still reproiducible.

        Show
        sirajg added a comment - I cannot reproduce it with b31 or the current build. I created a new config, made modifications to the logger settings and clicked Save. I tried with a config associated with and instance and without an instance. It worked in both the cases. There was an issue in logging backend earlier which would have produced similar result. Don't have that issue number. Closing as not reproducible. Reopen with more details if it is still reproiducible.
        Hide
        shaline added a comment -

        This issue is existing on latest GF nightly builds dated b37-01-11-2011 on Windows, and Sparc platforms.
        When we try to edit a instances config ( not the server-config), but a local or remote instances config's Logger settings/General page and click SAVE button, we see the java.lang.RuntimeException in the Console.
        In the server.log the below NullPointerException is thrown:

        [#|2011-01-11T16:27:19.186-0800|SEVERE|oracle-glassfish3.1|javax.enterprise.syst
        em.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=38;_ThreadName=Thread-1;|Ex
        ception in command execution : java.lang.NullPointerException
        java.lang.NullPointerException
        at com.sun.enterprise.server.logging.commands.SetLogAttributes.execute(S
        etLogAttributes.java:172)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunner
        Impl.java:354)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunner
        Impl.java:369)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunner
        Impl.java:1080)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunn
        erImpl.java:95)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execut
        e(CommandRunnerImpl.java:1260)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execut
        e(CommandRunnerImpl.java:1248)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:
        453)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:22
        0)
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java
        :168)
        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java
        :117)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(Container
        Mapper.java:234)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:8
        18)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1008)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFil
        ter.java:225)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultPro
        tocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.jav
        a:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.jav
        a:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java
        :79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextT
        ask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.
        java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadP
        ool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool
        .java:513)
        at java.lang.Thread.run(Thread.java:662)

        #]
        Show
        shaline added a comment - This issue is existing on latest GF nightly builds dated b37-01-11-2011 on Windows, and Sparc platforms. When we try to edit a instances config ( not the server-config), but a local or remote instances config's Logger settings/General page and click SAVE button, we see the java.lang.RuntimeException in the Console. In the server.log the below NullPointerException is thrown: [#|2011-01-11T16:27:19.186-0800|SEVERE|oracle-glassfish3.1|javax.enterprise.syst em.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=38;_ThreadName=Thread-1;|Ex ception in command execution : java.lang.NullPointerException java.lang.NullPointerException at com.sun.enterprise.server.logging.commands.SetLogAttributes.execute(S etLogAttributes.java:172) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunner Impl.java:354) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunner Impl.java:369) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunner Impl.java:1080) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunn erImpl.java:95) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execut e(CommandRunnerImpl.java:1260) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execut e(CommandRunnerImpl.java:1248) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java: 453) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:22 0) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java :168) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java :117) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(Container Mapper.java:234) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:8 18) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1008) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFil ter.java:225) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultPro tocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.jav a:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.jav a:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java :79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextT ask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask. java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadP ool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool .java:513) at java.lang.Thread.run(Thread.java:662) #]
        Hide
        Anissa Lam added a comment -

        I can reproduce this consistently when trying to do a SAVE on the General tab of Logger Settings, where the config is that of a RUNNING server.
        The server has to be running to see this exception.
        However, GUI wasn't calling the restRequest() method with the correct parameter, so instead of showing the user the error from the backend, we throw the exception on screen.

        I am going to fix the GUI code to ensure that if there is any error in backend, that the error will be shown correctly. (see attached screen which is after the change below). And then transfer the bug to logging.

        How bad is its impact? (Severity)
        GUI throws an exception on screen is not acceptable.

        How often does it happen? (Frequency)
        Everytime when doing a save in the logger settings General and Logger level screen, and there is any error reported by backend.

        How much effort is required to fix it? (Cost)
        1 hour

        What is the risk of fixing it? (Risk)
        almost no risk

        Does a work around for the issue exist? Can the workaround be reasonably employed by the end user?
        No

        If the issue is not fixed should the issue and its workaround (if applicable) be described in the Release Notes?
        No.

        svn diff

        ~/Awork/V3/v3/admingui 152) svn diff common
        Index: common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java
        ===================================================================
        — common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java (revision 44400)
        +++ common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java (working copy)
        @@ -134,7 +134,7 @@
        props.put("id", oneRow.get("loggerName") + "=" + oneRow.get("level"));
        props.put("target", config);
        RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-levels.json",

        • props, "POST", null, true);
          + props, "POST", handlerCtx, true, true);
          }

        }
        @@ -156,7 +156,7 @@
        props.put("id", key + "='" + attrs.get(key) + "'");
        props.put("target", config);
        RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-attributes.json",

        • props, "POST", null, true);
          + props, "POST", handlerCtx, true, true);
          }
          }
        Show
        Anissa Lam added a comment - I can reproduce this consistently when trying to do a SAVE on the General tab of Logger Settings, where the config is that of a RUNNING server. The server has to be running to see this exception. However, GUI wasn't calling the restRequest() method with the correct parameter, so instead of showing the user the error from the backend, we throw the exception on screen. I am going to fix the GUI code to ensure that if there is any error in backend, that the error will be shown correctly. (see attached screen which is after the change below). And then transfer the bug to logging. How bad is its impact? (Severity) GUI throws an exception on screen is not acceptable. How often does it happen? (Frequency) Everytime when doing a save in the logger settings General and Logger level screen, and there is any error reported by backend. How much effort is required to fix it? (Cost) 1 hour What is the risk of fixing it? (Risk) almost no risk Does a work around for the issue exist? Can the workaround be reasonably employed by the end user? No If the issue is not fixed should the issue and its workaround (if applicable) be described in the Release Notes? No. svn diff ~/Awork/V3/v3/admingui 152) svn diff common Index: common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java =================================================================== — common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java (revision 44400) +++ common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java (working copy) @@ -134,7 +134,7 @@ props.put("id", oneRow.get("loggerName") + "=" + oneRow.get("level")); props.put("target", config); RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-levels.json", props, "POST", null, true); + props, "POST", handlerCtx, true, true); } } @@ -156,7 +156,7 @@ props.put("id", key + "='" + attrs.get(key) + "'"); props.put("target", config); RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-attributes.json", props, "POST", null, true); + props, "POST", handlerCtx, true, true); } }
        Hide
        Anissa Lam added a comment -

        While doing more testing, i see that the .jsf file called prepareSuccessfulMsg AFTER calling the handler. This overwrites any warning from the handler. So, I am moving that to before calling the handler.
        We should always call prepareSuccessful before any handler. If there is any exception/failure in the handler, the sequence command will not continue and no need to worry that prepareSuccessful will be called.

        We also break out of the for loop if there is any error in the request, instead of continue to set more attributes.
        So, here is the new diff.

        ~/Awork/V3/v3/admingui/common 158) svn diff
        Index: src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java
        ===================================================================
        — src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java (revision 44400)
        +++ src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java (working copy)
        @@ -1,7 +1,7 @@
        /*

        • DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
          *
        • * Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved.
          + * Copyright (c) 2009-2011 Oracle and/or its affiliates. All rights reserved.
          *
        • The contents of this file are subject to the terms of either the GNU
        • General Public License Version 2 only ("GPL") or the Common Development
          @@ -130,11 +130,15 @@
          List<Map<String,Object>> allRows = (List<Map<String,Object>>) handlerCtx.getInputValue("allRows");
          String config = (String)handlerCtx.getInputValue("config");
          Map<String, Object> props = new HashMap();
        • for(Map<String, Object> oneRow : allRows){
        • props.put("id", oneRow.get("loggerName") + "=" + oneRow.get("level"));
        • props.put("target", config);
        • RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-levels.json",
        • props, "POST", null, true);
          + try
          Unknown macro: {+ for(Map<String, Object> oneRow }

          catch(Exception ex)

          { + GuiUtil.handleException(handlerCtx, ex); }

          }
          @@ -152,11 +156,15 @@
          String[] attrNames = attrsInUI.split(",");
          String config = (String)handlerCtx.getInputValue("config");
          Map<String, Object> props = new HashMap();
          - for(String key : attrNames){
          - props.put("id", key + "='" + attrs.get(key) + "'");
          - props.put("target", config);
          - RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-attributes.json",
          - props, "POST", null, true);
          + try{
          + for(String key : attrNames){ + props.put("id", key + "='" + attrs.get(key) + "'"); + props.put("target", config); + RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-attributes.json", + props, "POST", null, false, true); + }
          + }catch (Exception ex){ + GuiUtil.handleException(handlerCtx, ex); }

          }

        Index: src/main/resources/configuration/loggerLevelsButtons.jsf
        ===================================================================
        — src/main/resources/configuration/loggerLevelsButtons.jsf (revision 44400)
        +++ src/main/resources/configuration/loggerLevelsButtons.jsf (working copy)
        @@ -47,8 +47,8 @@
        <!command
        getUIComponent(clientId="$pageSession

        {tableRowGroupId}

        ", component=>$attribute

        {tableRowGroup});
        getAllSingleMapRows(TableRowGroup="${tableRowGroup}

        " Rows=>$attribute

        {allRows}

        );
        + prepareSuccessfulMsg();
        updateLoggerLevels(allRows="#

        {requestScope.allRows}

        " config="#

        {pageSession.configName}");
        - prepareSuccessfulMsg();
        gf.redirect(page="#{request.contextPath}/common/configuration/loggerLevels.jsf?configName=#{pageSession.configName}

        &alertType=$

        {alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}");
        />
        </sun:button>
        Index: src/main/resources/configuration/loggerGeneral.jsf
        ===================================================================
        — src/main/resources/configuration/loggerGeneral.jsf (revision 44400)
        +++ src/main/resources/configuration/loggerGeneral.jsf (working copy)
        @@ -85,8 +85,8 @@
        <sun:button id="saveButton" text="$resource{i18n.button.Save}"
        onClick="if (guiValidate('#{reqMsg}','#{reqInt}','#{reqPort}')) {submitAndDisable(this, '$resource{i18n.button.Processing}');}; return false;" >
        <!command
        + prepareSuccessfulMsg();
        saveLoggingAttributes(attrs="#{pageSession.logAttributes}" attrsInUI="#{pageSession.attrsInUI}" config="#{pageSession.configName}");
        - prepareSuccessfulMsg();
        gf.redirect(page="#{request.contextPath}/common/configuration/loggerGeneral.jsf?configName=#{pageSession.configName}&alertType=${alertType}

        &alertSummary=$

        {alertSummary}

        &alertDetail=$

        {alertDetail}

        ");
        />
        </sun:button>

        Show
        Anissa Lam added a comment - While doing more testing, i see that the .jsf file called prepareSuccessfulMsg AFTER calling the handler. This overwrites any warning from the handler. So, I am moving that to before calling the handler. We should always call prepareSuccessful before any handler. If there is any exception/failure in the handler, the sequence command will not continue and no need to worry that prepareSuccessful will be called. We also break out of the for loop if there is any error in the request, instead of continue to set more attributes. So, here is the new diff. ~/Awork/V3/v3/admingui/common 158) svn diff Index: src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java =================================================================== — src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java (revision 44400) +++ src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java (working copy) @@ -1,7 +1,7 @@ /* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009-2011 Oracle and/or its affiliates. All rights reserved. * The contents of this file are subject to the terms of either the GNU General Public License Version 2 only ("GPL") or the Common Development @@ -130,11 +130,15 @@ List<Map<String,Object>> allRows = (List<Map<String,Object>>) handlerCtx.getInputValue("allRows"); String config = (String)handlerCtx.getInputValue("config"); Map<String, Object> props = new HashMap(); for(Map<String, Object> oneRow : allRows){ props.put("id", oneRow.get("loggerName") + "=" + oneRow.get("level")); props.put("target", config); RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-levels.json", props, "POST", null, true); + try Unknown macro: {+ for(Map<String, Object> oneRow } catch(Exception ex) { + GuiUtil.handleException(handlerCtx, ex); } } @@ -152,11 +156,15 @@ String[] attrNames = attrsInUI.split(","); String config = (String)handlerCtx.getInputValue("config"); Map<String, Object> props = new HashMap(); - for(String key : attrNames){ - props.put("id", key + "='" + attrs.get(key) + "'"); - props.put("target", config); - RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-attributes.json", - props, "POST", null, true); + try{ + for(String key : attrNames){ + props.put("id", key + "='" + attrs.get(key) + "'"); + props.put("target", config); + RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-attributes.json", + props, "POST", null, false, true); + } + }catch (Exception ex){ + GuiUtil.handleException(handlerCtx, ex); } } Index: src/main/resources/configuration/loggerLevelsButtons.jsf =================================================================== — src/main/resources/configuration/loggerLevelsButtons.jsf (revision 44400) +++ src/main/resources/configuration/loggerLevelsButtons.jsf (working copy) @@ -47,8 +47,8 @@ <!command getUIComponent(clientId="$pageSession {tableRowGroupId} ", component=>$attribute {tableRowGroup}); getAllSingleMapRows(TableRowGroup="${tableRowGroup} " Rows=>$attribute {allRows} ); + prepareSuccessfulMsg(); updateLoggerLevels(allRows="# {requestScope.allRows} " config="# {pageSession.configName}"); - prepareSuccessfulMsg(); gf.redirect(page="#{request.contextPath}/common/configuration/loggerLevels.jsf?configName=#{pageSession.configName} &alertType=$ {alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}"); /> </sun:button> Index: src/main/resources/configuration/loggerGeneral.jsf =================================================================== — src/main/resources/configuration/loggerGeneral.jsf (revision 44400) +++ src/main/resources/configuration/loggerGeneral.jsf (working copy) @@ -85,8 +85,8 @@ <sun:button id="saveButton" text="$resource{i18n.button.Save}" onClick="if (guiValidate('#{reqMsg}','#{reqInt}','#{reqPort}')) {submitAndDisable(this, '$resource{i18n.button.Processing}');}; return false;" > <!command + prepareSuccessfulMsg(); saveLoggingAttributes(attrs="#{pageSession.logAttributes}" attrsInUI="#{pageSession.attrsInUI}" config="#{pageSession.configName}"); - prepareSuccessfulMsg(); gf.redirect(page="#{request.contextPath}/common/configuration/loggerGeneral.jsf?configName=#{pageSession.configName}&alertType=${alertType} &alertSummary=$ {alertSummary} &alertDetail=$ {alertDetail} "); /> </sun:button>
        Hide
        sirajg added a comment -

        Changes look good

        Show
        sirajg added a comment - Changes look good
        Hide
        Anissa Lam added a comment -

        Fix checked in on 1/12.

        Project: glassfish
        Repository: svn
        Revision: 44440
        Author: anilam
        Date: 2011-01-12 15:48:34 UTC
        Link:

        Log Message:
        ------------
        Fix GLASSFISH-15050 . Ensure the error from logging backend will be displayed to user appropriately instead of throwing the exception on screen.

        Approved: self-approve
        Reviewer: Siraj.

        Revisions:
        ----------
        44440

        Modified Paths:
        ---------------
        trunk/v3/admingui/common/src/main/resources/configuration/loggerLevelsButtons.jsf
        trunk/v3/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java
        trunk/v3/admingui/common/src/main/resources/configuration/loggerGeneral.jsf
        trunk/v3/admingui/common/src/main/java/org/glassfish/admingui/common/util/RestUtil.java

        Show
        Anissa Lam added a comment - Fix checked in on 1/12. Project: glassfish Repository: svn Revision: 44440 Author: anilam Date: 2011-01-12 15:48:34 UTC Link: Log Message: ------------ Fix GLASSFISH-15050 . Ensure the error from logging backend will be displayed to user appropriately instead of throwing the exception on screen. Approved: self-approve Reviewer: Siraj. Revisions: ---------- 44440 Modified Paths: --------------- trunk/v3/admingui/common/src/main/resources/configuration/loggerLevelsButtons.jsf trunk/v3/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/LoggingHandlers.java trunk/v3/admingui/common/src/main/resources/configuration/loggerGeneral.jsf trunk/v3/admingui/common/src/main/java/org/glassfish/admingui/common/util/RestUtil.java
        Hide
        Anissa Lam added a comment -

        I don't mean to close this. Since the underlying issue is in logging. GUI is just fixed so that GUI will display the error from backend.
        However those error shouldn't occur at all.

        Show
        Anissa Lam added a comment - I don't mean to close this. Since the underlying issue is in logging. GUI is just fixed so that GUI will display the error from backend. However those error shouldn't occur at all.
        Hide
        Anissa Lam added a comment -

        Transferring to logging.
        If the instance is not running, logger/loglevel setting can be changed.
        But if the instance is running, we are seeing this error:

        [#|2011-01-12T12:54:41.000-0800|INFO|glassfish3.1|org.glassfish.admingui|_ThreadID=27;_ThreadName=admin-thread-pool-4848(4);|Exception Occurred :An error occurred during replication FAILURE: Command set-log-attributes failed on server instance ST2: remote failure: java.lang.NullPointerException|#]

        Show
        Anissa Lam added a comment - Transferring to logging. If the instance is not running, logger/loglevel setting can be changed. But if the instance is running, we are seeing this error: [#|2011-01-12T12:54:41.000-0800|INFO|glassfish3.1|org.glassfish.admingui|_ThreadID=27;_ThreadName=admin-thread-pool-4848(4);|Exception Occurred :An error occurred during replication FAILURE: Command set-log-attributes failed on server instance ST2: remote failure: java.lang.NullPointerException|#]
        Hide
        naman_mehta added a comment -

        Hi anissa,
        I recently fixed one issue(11th Jan) on the same line: http://java.net/jira/browse/GLASSFISH-15510

        So looks like it's same one. I will verify the same and closing this issue. Is it fine?

        Show
        naman_mehta added a comment - Hi anissa, I recently fixed one issue(11th Jan) on the same line: http://java.net/jira/browse/GLASSFISH-15510 So looks like it's same one. I will verify the same and closing this issue. Is it fine?
        Hide
        naman_mehta added a comment -

        I verified the issue by doing following steps.

        1. Started Server
        2. Created local instance in1
        3. Created local instance in2
        4. Started local instance in1.
        5. Open admin console
        6. Go to in1-config, Logger Settings, General. Updated value for two checkboxes and did save. It works fine.
        7. Go to in2-config, Logger Settings, General. Updated value for two checkboxes and did save. It works fine.

        So here, in1 is running and in2 is stopped but logger setting works fine in both condition. No exception in the GUI and back end.

        Do I need to test other thing apart from the same? If no, can I close this issue?

        Show
        naman_mehta added a comment - I verified the issue by doing following steps. 1. Started Server 2. Created local instance in1 3. Created local instance in2 4. Started local instance in1. 5. Open admin console 6. Go to in1-config, Logger Settings, General. Updated value for two checkboxes and did save. It works fine. 7. Go to in2-config, Logger Settings, General. Updated value for two checkboxes and did save. It works fine. So here, in1 is running and in2 is stopped but logger setting works fine in both condition. No exception in the GUI and back end. Do I need to test other thing apart from the same? If no, can I close this issue?
        Hide
        naman_mehta added a comment -

        Also verfied,

        Create a new configuration by copying from default-config.
        In the newconfig/Logger Settings/General Page, Edit some fields, and/or enable "Write to System log" checkbox, or" Log ot Console" checkbox and click "Save" button.

        Works fine without any Exception.

        Show
        naman_mehta added a comment - Also verfied, Create a new configuration by copying from default-config. In the newconfig/Logger Settings/General Page, Edit some fields, and/or enable "Write to System log" checkbox, or" Log ot Console" checkbox and click "Save" button. Works fine without any Exception.
        Hide
        naman_mehta added a comment -

        Closing this issue as it is not reproducible on latest workspace.

        Show
        naman_mehta added a comment - Closing this issue as it is not reproducible on latest workspace.
        Hide
        Anissa Lam added a comment -

        I was able to reproduce the issue consistently, until i update to the latest code under core/logging.
        so, sounds like code checked in yesterday to fix the other logging bug fixes this issue also.
        Shalini can verify this.

        Show
        Anissa Lam added a comment - I was able to reproduce the issue consistently, until i update to the latest code under core/logging. so, sounds like code checked in yesterday to fix the other logging bug fixes this issue also. Shalini can verify this.
        Hide
        shaline added a comment -

        Verified in promoted b43.

        Show
        shaline added a comment - Verified in promoted b43.

          People

          • Assignee:
            naman_mehta
            Reporter:
            shaline
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved: