glassfish
  1. glassfish
  2. GLASSFISH-14861

class java.lang.RuntimeException while editing a customrealm

    Details

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

      os: Solaris Sparc 10
      Browser: firefox 3.6

      Description

      build used : GF V3.1 nightly dated 11/29

      Created a custom realm under server-config/security/realms, after placing the custom classes domain1/lib/classes dir.
      class: samples.security.customrealm.SimpleCustomRealm
      Added properties
      auth-type: simplecustomrealm
      jaas-context : simpleCustomRealm

      new custom realm was created succesfully. Now select the realm,
      1)In the Edit Realm page, the Properties Jaas context and auth-type do not show up.
      2) When we try to edit the class name field and click SAVE button, we get ,"java.lang.RuntimeException"

      server.log has the below Exception:
      [#|2010-11-29T14:01:38.114-0800|SEVERE|glassfish3.1|org.glassfish.admingui|_Thre
      adID=15;_ThreadName=Thread-1;|RestResponse.getResponse() failed. endpoint = 'ht
      tp://localhost:4848/management/domain/configs/config/server-config/security-serv
      ice/auth-realm//property.json'; attrs = '{}'; RestResponse: "|#]

      [#|2010-11-29T14:01:38.123-0800|SEVERE|glassfish3.1|javax.enterprise.system.std.
      com.sun.enterprise.server.logging|_ThreadID=15;_ThreadName=Thread-1;|java.lang.R
      untimeException: java.lang.reflect.InvocationTargetException while attempting to
      process a 'beforeCreate' event for 'event209'.
      at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHa
      ndlers(LayoutElementBase.java:422)
      at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHa
      ndlers(LayoutElementBase.java:394)
      at com.sun.jsftemplating.layout.descriptors.LayoutComponent.beforeCreate
      (LayoutComponent.java:348)
      at com.sun.jsftemplating.layout.descriptors.LayoutComponent.getChild(Lay
      outComponent.java:288)
      at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(L
      ayoutViewHandler.java:556)
      at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(L
      ayoutViewHandler.java:551)
      at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(L
      ayoutViewHandler.java:507)
      at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(L
      ayoutViewHandler.java:507)
      at com.sun.jsftemplating.layout.LayoutViewHandler.createView(LayoutViewH
      andler.java:255)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.jav
      a:244)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.jav
      a:113)
      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(Appl
      icationFilterChain.java:343)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:215)
      at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:233)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:215)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:279)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:175)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.j
      ava:655)
      at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipel
      ine.java:600)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESess
      ionLockingStandardPipeline.java:91)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:162)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.j
      ava:326)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:227)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(Container
      Mapper.java:228)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:8
      17)
      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(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:619)
      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(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handl
      er.java:442)
      at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHa
      ndlers(LayoutElementBase.java:420)
      ... 43 more
      Caused by: java.lang.RuntimeException:
      at org.glassfish.admingui.common.util.RestUtil.parseResponse(RestUtil.ja
      va:310)
      at org.glassfish.admingui.common.util.RestUtil.restRequest(RestUtil.java
      :179)
      at org.glassfish.admingui.common.util.RestUtil.restRequest(RestUtil.java
      :134)
      at org.glassfish.admingui.common.handlers.SecurityHandler.getRealmAttrFo
      rEdit(SecurityHandler.java:105)
      ... 49 more

      class java.lang.RuntimeException

      1. login.conf
        3 kB
        shaline
      2. SimpleCustomLoginModule.class
        2 kB
        shaline
      3. SimpleCustomRealm.class
        5 kB
        shaline

        Activity

        Hide
        srinik76 added a comment -

        The issue which was used to make classname only readable

        http://java.net/jira/browse/GLASSFISH-15345

        Show
        srinik76 added a comment - The issue which was used to make classname only readable http://java.net/jira/browse/GLASSFISH-15345
        Hide
        srinik76 added a comment -

        Attaching the fix

        Index: src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java
        ===================================================================
        — src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java (revision 44732)
        +++ src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java (working copy)
        @@ -169,6 +169,7 @@
        //Custom realm class
        handlerCtx.setOutputValue("classnameOption", "input");
        attrMap.put("predefinedClassname", Boolean.FALSE);
        + attrMap.put("classnameInput", classname);
        attrMap.put("classname", classname);
        List props = getChildrenMapForTableList(origProps, "property", null);
        handlerCtx.setOutputValue("properties", props);

        Show
        srinik76 added a comment - Attaching the fix Index: src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java =================================================================== — src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java (revision 44732) +++ src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java (working copy) @@ -169,6 +169,7 @@ //Custom realm class handlerCtx.setOutputValue("classnameOption", "input"); attrMap.put("predefinedClassname", Boolean.FALSE); + attrMap.put("classnameInput", classname); attrMap.put("classname", classname); List props = getChildrenMapForTableList(origProps, "property", null); handlerCtx.setOutputValue("properties", props);
        Hide
        Anissa Lam added a comment - - edited

        1. How bad is its impact? (Severity)
        Cannot edit custom realm.

        2. How often does it happen? (Frequency)
        everytime when trying to edit the custom realm.

        3. How much effort is required to fix it? (Cost)
        Srini spent couple hours on this.

        4. What is the risk of fixing it? (Risk)
        Small.

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

        6. If the issue is not fixed should the issue and its workaround (if applicable) be described in the Release Notes?
        No. don't think it helps just telling user they cannot edit the customer realm in GUI, when they have alreay realize that.

        7. How long has the bug existed in the product?
        Since 12/29 when fixing GLASSFISH-15345

        8. Do regression tests exist for this issue?
        no. we cannot add this to the devtest as it requires modification of domain1/config/login.conf file. Currently, we cannot do this kind of 'customization' in the devtest code.

        9. Which tests should QA (re)run to validate the fix did not destabilize GlassFish?
        They will need to manually test this custom realm creation and editing.

        10. When will a tested fix be ready for integration?
        It is ready now.
        I have created a patch based on the above svn diff that Srini provided. Shaline has tested that patch and confirm that solve the issue.
        I was hoping to check this in for Srini as i prefer to have this in before waiting for next week. (its weekend now at IEC)

        Show
        Anissa Lam added a comment - - edited 1. How bad is its impact? (Severity) Cannot edit custom realm. 2. How often does it happen? (Frequency) everytime when trying to edit the custom realm. 3. How much effort is required to fix it? (Cost) Srini spent couple hours on this. 4. What is the risk of fixing it? (Risk) Small. 5. Does a work around for the issue exist? Can the workaround be reasonably employed by the end user? No. 6. If the issue is not fixed should the issue and its workaround (if applicable) be described in the Release Notes? No. don't think it helps just telling user they cannot edit the customer realm in GUI, when they have alreay realize that. 7. How long has the bug existed in the product? Since 12/29 when fixing GLASSFISH-15345 8. Do regression tests exist for this issue? no. we cannot add this to the devtest as it requires modification of domain1/config/login.conf file. Currently, we cannot do this kind of 'customization' in the devtest code. 9. Which tests should QA (re)run to validate the fix did not destabilize GlassFish? They will need to manually test this custom realm creation and editing. 10. When will a tested fix be ready for integration? It is ready now. I have created a patch based on the above svn diff that Srini provided. Shaline has tested that patch and confirm that solve the issue. I was hoping to check this in for Srini as i prefer to have this in before waiting for next week. (its weekend now at IEC)
        Hide
        Anissa Lam added a comment -

        Fix checked into the branch (svn# 44783) and Trunk (svn# 44785)

        =====================================
        Project: glassfish
        Repository: svn
        Revision: 44783
        Author: anilam
        Date: 2011-01-29 06:54:10 UTC
        Link:

        Log Message:
        ------------

        GLASSFISH-14861. Fix edit custom realm.
        Approved by Nazrul. Patch tested by Shaline.

        Revisions:
        ----------
        44783

        Modified Paths:
        ---------------
        branches/3.1/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java

        =================================

        Project: glassfish
        Repository: svn
        Revision: 44785
        Author: anilam
        Date: 2011-01-29 07:55:30 UTC
        Link:

        Log Message:
        ------------
        GLASSFISH-14861. Fix edit custom realm.
        Approved by Nazrul. Patch tested by Shaline.
        checked in branch as rev#44783

        Revisions:
        ----------
        44785

        Modified Paths:
        ---------------
        trunk/v3/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java

        Show
        Anissa Lam added a comment - Fix checked into the branch (svn# 44783) and Trunk (svn# 44785) ===================================== Project: glassfish Repository: svn Revision: 44783 Author: anilam Date: 2011-01-29 06:54:10 UTC Link: Log Message: ------------ GLASSFISH-14861 . Fix edit custom realm. Approved by Nazrul. Patch tested by Shaline. Revisions: ---------- 44783 Modified Paths: --------------- branches/3.1/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java ================================= Project: glassfish Repository: svn Revision: 44785 Author: anilam Date: 2011-01-29 07:55:30 UTC Link: Log Message: ------------ GLASSFISH-14861 . Fix edit custom realm. Approved by Nazrul. Patch tested by Shaline. checked in branch as rev#44783 Revisions: ---------- 44785 Modified Paths: --------------- trunk/v3/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/SecurityHandler.java
        Hide
        shaline added a comment -

        Verified in b42 nightly dated 02-09-11

        Show
        shaline added a comment - Verified in b42 nightly dated 02-09-11

          People

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

            Dates

            • Created:
              Updated:
              Resolved: