glassfish
  1. glassfish
  2. GLASSFISH-15261

cannot launch Admin Console: javax.servlet.ServletException: thrown in browser.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1_b33
    • Fix Version/s: 3.1_b34
    • Component/s: rest-interface
    • Labels:
      None
    • Environment:

      OS: Solaris Sparc
      Browser : firefox 3.6

      Description

      Build Used : latest GF nightly dated b34_12/17.

      Installed the latest GF nightly using the latest-ogs.zip bundle, and started the domain. Launched the Admin Console, using http://hostname:4848.
      The below Exception is shown in the browser:

      HTTP Status 500 -
      type Exception report
      message

      descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

      exception

      javax.servlet.ServletException: java.lang.reflect.InvocationTargetException while attempting to process a 'beforeCreate' event for 'treeForm'.

      root cause

      java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'beforeCreate' event for 'treeForm'.

      root cause

      java.lang.reflect.InvocationTargetException

      root cause

      java.lang.NullPointerException

      note The full stack traces of the exception and its root causes are available in the Oracle GlassFish Server 3.1 logs.

      Oracle GlassFish Server 3.1

      server.log has the below Exception:

      [#|2010-12-17T15:20:39.931-0800|SEVERE|oracle-glassfish3.1|com.sun.jersey.spi.co
      ntainer.ContainerResponse|_ThreadID=15;_ThreadName=Thread-1;|The RuntimeExceptio
      n could not be mapped to a response, re-throwing to the HTTP container
      java.lang.NullPointerException
      at org.glassfish.admin.rest.ResourceUtil.getParamMetaData(ResourceUtil.j
      ava:441)
      at org.glassfish.admin.rest.ResourceUtil.getMethodMetaData(ResourceUtil.
      java:256)
      at org.glassfish.admin.rest.ResourceUtil.getMethodMetaData(ResourceUtil.
      java:236)
      at org.glassfish.admin.rest.resources.TemplateListOfResource.getMethodMe
      taData(TemplateListOfResource.java:360)
      at org.glassfish.admin.rest.resources.TemplateListOfResource.buildAction
      ReportResult(TemplateListOfResource.java:286)
      at org.glassfish.admin.rest.resources.TemplateListOfResource.get(Templat
      eListOfResource.java:100)
      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.jersey.server.impl.model.method.dispatch.AbstractResourceMeth
      odDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchPr
      ovider.java:186)
      at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDi
      spatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
      at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethod
      Rule.java:279)
      at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocator
      Rule.java:121)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHa
      ndPathRule.java:136)
      at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocator
      Rule.java:121)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHa
      ndPathRule.java:136)
      at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(Resourc
      eClassRule.java:86)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHa
      ndPathRule.java:136)
      at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(R
      ootResourceClassesRule.java:74)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequ
      est(WebApplicationImpl.java:1347)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequ
      est(WebApplicationImpl.java:1279)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleReque
      st(WebApplicationImpl.java:1229)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleReque
      st(WebApplicationImpl.java:1219)
      at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._servic
      e(GrizzlyContainer.java:180)
      at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service
      (GrizzlyContainer.java:145)
      at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java
      :180)
      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
      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:662)

      #]

      [#|2010-12-17T15:20:39.950-0800|SEVERE|oracle-glassfish3.1|org.glassfish.admingu
      i|_ThreadID=15;_ThreadName=Thread-1;|RestResponse.getResponse() failed. endpoin
      t = 'http://localhost:4848/management/domain/configs/config.json'; attrs = '{}'|
      #]

        Activity

        Hide
        Anissa Lam added a comment - - edited

        Does this happen consistently ?
        If GUI can't launch, QL will fail too. I have the latest workspace, but i am not seeing this. Shing Wai mentioned he saw this occasionally.

        The NPE is from REST, and it is a valid request
        http://localhost:4848/management/domain/configs/config.json';

        Transfer to REST for investigation.

        Show
        Anissa Lam added a comment - - edited Does this happen consistently ? If GUI can't launch, QL will fail too. I have the latest workspace, but i am not seeing this. Shing Wai mentioned he saw this occasionally. The NPE is from REST, and it is a valid request http://localhost:4848/management/domain/configs/config.json '; Transfer to REST for investigation.
        Hide
        Anissa Lam added a comment -

        Please attache server.log

        Show
        Anissa Lam added a comment - Please attache server.log
        Hide
        shaline added a comment -

        Attached the server.log
        Used the bundle latest-ogs.zip and was able to reproduce this consistenly.
        even deleted and recreated a new domain, and saw the same issue with the new domain as well.

        Show
        shaline added a comment - Attached the server.log Used the bundle latest-ogs.zip and was able to reproduce this consistenly. even deleted and recreated a new domain, and saw the same issue with the new domain as well.
        Hide
        Anissa Lam added a comment -

        With the 12/17 nightly build for OGS and OpenSource version, I can reproduce the problem consistently on my Mac.
        I can also reproduce this after i updated my workspace.
        With Mitesh patch jar that gives more debug info, I am seeing the following:

        [#|2010-12-17T19:47:43.082-0800|INFO|oracle-glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=17;_ThreadName=Thread-1;|*****Got model as:null commandName:create-config|#]

        [#|2010-12-17T19:47:43.083-0800|SEVERE|oracle-glassfish3.1|com.sun.jersey.spi.container.ContainerResponse|_ThreadID=17;_ThreadName=Thread-1;|The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
        java.lang.NullPointerException
        at org.glassfish.admin.rest.ResourceUtil.getParamMetaData(ResourceUtil.java:442)
        at org.glassfish.admin.rest.ResourceUtil.getMethodMetaData(ResourceUtil.java:256)

        The create-config call is very suspicious.
        This is related to the checkin from Bhaki for GLASSFISH-15214

        The "create-config" command is removed.
        Diffs:
        ------
        Index: trunk/v3/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java
        ===================================================================
        — trunk/v3/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java (revision 43911)
        +++ trunk/v3/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java (revision 43912)
        @@ -65,7 +65,7 @@

        • </pre>
        • <p/> <p/> <p/> Objects of the following type(s) are allowed in the list {@link Config }

          */

        • @Create(value="create-config", i18n=@I18n("create.config.command"))
          +
          @Element(required=true)
          List<Config> getConfig();

        I looked at the REST source code, in ResourcesGeneratorBase.java, it has:

        put("ListConfig", "create-config");

        It probably didn't realize "create-config" is being removed and thus the problem.

        Show
        Anissa Lam added a comment - With the 12/17 nightly build for OGS and OpenSource version, I can reproduce the problem consistently on my Mac. I can also reproduce this after i updated my workspace. With Mitesh patch jar that gives more debug info, I am seeing the following: [#|2010-12-17T19:47:43.082-0800|INFO|oracle-glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=17;_ThreadName=Thread-1;|*****Got model as:null commandName:create-config|#] [#|2010-12-17T19:47:43.083-0800|SEVERE|oracle-glassfish3.1|com.sun.jersey.spi.container.ContainerResponse|_ThreadID=17;_ThreadName=Thread-1;|The RuntimeException could not be mapped to a response, re-throwing to the HTTP container java.lang.NullPointerException at org.glassfish.admin.rest.ResourceUtil.getParamMetaData(ResourceUtil.java:442) at org.glassfish.admin.rest.ResourceUtil.getMethodMetaData(ResourceUtil.java:256) The create-config call is very suspicious. This is related to the checkin from Bhaki for GLASSFISH-15214 The "create-config" command is removed. Diffs: ------ Index: trunk/v3/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java =================================================================== — trunk/v3/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java (revision 43911) +++ trunk/v3/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java (revision 43912) @@ -65,7 +65,7 @@ </pre> <p/> <p/> <p/> Objects of the following type(s) are allowed in the list {@link Config } */ @Create(value="create-config", i18n=@I18n("create.config.command")) + @Element(required=true) List<Config> getConfig(); I looked at the REST source code, in ResourcesGeneratorBase.java, it has: put("ListConfig", "create-config"); It probably didn't realize "create-config" is being removed and thus the problem.
        Hide
        Anissa Lam added a comment -

        I have tried to add back create-config, but make that a hidden command, and changed REST code to refer to the hidden command, everything works.

        Thats the only solution i can think of now, maybe the REST team knows how to do ListConfig without create-config at all.

        Here is the diff to solve the problem, and make GUI working again.
        I have tested GUI manually, and also run QL test.
        [echo] [testng] ===============================================
        [echo] [testng] QuickLookTests
        [echo] [testng] Total tests run: 127, Failures: 0, Skips: 0
        [echo] [testng] ===============================================

        ~/Awork/V3/NOW/v3 757) svn diff admin
        Index: admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java
        ===================================================================
        — admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java (revision 43930)
        +++ admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java (working copy)
        @@ -65,7 +65,7 @@

        • </pre>
        • <p/> <p/> <p/> Objects of the following type(s) are allowed in the list {@link Config }

          */
          -
          + @Create(value="_create-config", i18n=@I18n("create.config.command"))
          @Element(required=true)
          List<Config> getConfig();

        Index: admin/rest/src/main/java/org/glassfish/admin/rest/generator/ResourcesGeneratorBase.java
        ===================================================================
        — admin/rest/src/main/java/org/glassfish/admin/rest/generator/ResourcesGeneratorBase.java (revision 43930)
        +++ admin/rest/src/main/java/org/glassfish/admin/rest/generator/ResourcesGeneratorBase.java (working copy)
        @@ -514,7 +514,7 @@
        put("ListAuditModule", "create-audit-module");
        put("ListAuthRealm", "create-auth-realm");
        put("ListCluster", "create-cluster");

        • put("ListConfig", "create-config");
          + put("ListConfig", "_create-config");
          put("ListConnectorConnectionPool", "create-connector-connection-pool");
          put("ListConnectorResource", "create-connector-resource");
          put("ListCustomResource", "create-custom-resource");
          @@ -565,4 +565,4 @@
          put("UserGroup",new CollectionLeafMetaData("_create-user-group", "_delete-user-group", "User Group"));
          }};

        If the REST team thinks this is fine, I will ask for approval and check in. Or, they may have a better fix. Either way, I want to ensure Monday nightly build will have GUI working.

        Show
        Anissa Lam added a comment - I have tried to add back create-config, but make that a hidden command, and changed REST code to refer to the hidden command, everything works. Thats the only solution i can think of now, maybe the REST team knows how to do ListConfig without create-config at all. Here is the diff to solve the problem, and make GUI working again. I have tested GUI manually, and also run QL test. [echo] [testng] =============================================== [echo] [testng] QuickLookTests [echo] [testng] Total tests run: 127, Failures: 0, Skips: 0 [echo] [testng] =============================================== ~/Awork/V3/NOW/v3 757) svn diff admin Index: admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java =================================================================== — admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java (revision 43930) +++ admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Configs.java (working copy) @@ -65,7 +65,7 @@ </pre> <p/> <p/> <p/> Objects of the following type(s) are allowed in the list {@link Config } */ - + @Create(value="_create-config", i18n=@I18n("create.config.command")) @Element(required=true) List<Config> getConfig(); Index: admin/rest/src/main/java/org/glassfish/admin/rest/generator/ResourcesGeneratorBase.java =================================================================== — admin/rest/src/main/java/org/glassfish/admin/rest/generator/ResourcesGeneratorBase.java (revision 43930) +++ admin/rest/src/main/java/org/glassfish/admin/rest/generator/ResourcesGeneratorBase.java (working copy) @@ -514,7 +514,7 @@ put("ListAuditModule", "create-audit-module"); put("ListAuthRealm", "create-auth-realm"); put("ListCluster", "create-cluster"); put("ListConfig", "create-config"); + put("ListConfig", "_create-config"); put("ListConnectorConnectionPool", "create-connector-connection-pool"); put("ListConnectorResource", "create-connector-resource"); put("ListCustomResource", "create-custom-resource"); @@ -565,4 +565,4 @@ put("UserGroup",new CollectionLeafMetaData("_ create-user-group", " _delete-user-group", "User Group")); }}; If the REST team thinks this is fine, I will ask for approval and check in. Or, they may have a better fix. Either way, I want to ensure Monday nightly build will have GUI working.
        Hide
        Jason Lee added a comment -

        Looks good to me.

        Show
        Jason Lee added a comment - Looks good to me.
        Hide
        ludo added a comment -

        ok...
        People changing CLI should test admin gui,
        CLI is a public interface!!!
        Who is using this hidden cli now? If noboby, it should be removed

        Show
        ludo added a comment - ok... People changing CLI should test admin gui, CLI is a public interface!!! Who is using this hidden cli now? If noboby, it should be removed
        Hide
        Anissa Lam added a comment -

        Since this is reviewed by REST team, I will start the 3.1 change process to have the above changed code checked in. This ensure GUI works starting on Sunday nightly build.
        If there is preference to remove the hidden command, that will need to be done by admin and REST and ensure everything works fine again.

        How bad is its impact? (Severity)
        Severity 1. Blocking bug.

        How often does it happen?
        Whenever user wants to launch GUI.

        Will many users see this problem? (Frequency)
        Everyone.

        How much effort is required to fix it? (Cost)
        Several hours. svn diff is included in previous comment.

        What is the risk of fixing it and how will the risk be mitigated? (Risk)
        The risk should be min. I searched through entire v3 and didn't see anywhere else referencing "create-config". This cannot be worst than GUI not able to launch at all. Ran QL and manually tested GUI.

        Show
        Anissa Lam added a comment - Since this is reviewed by REST team, I will start the 3.1 change process to have the above changed code checked in. This ensure GUI works starting on Sunday nightly build. If there is preference to remove the hidden command, that will need to be done by admin and REST and ensure everything works fine again. How bad is its impact? (Severity) Severity 1. Blocking bug. How often does it happen? Whenever user wants to launch GUI. Will many users see this problem? (Frequency) Everyone. How much effort is required to fix it? (Cost) Several hours. svn diff is included in previous comment. What is the risk of fixing it and how will the risk be mitigated? (Risk) The risk should be min. I searched through entire v3 and didn't see anywhere else referencing "create-config". This cannot be worst than GUI not able to launch at all. Ran QL and manually tested GUI.
        Hide
        Anissa Lam added a comment -

        Fix checked in on 12/18. Should be available starting from 12/19 nightly build.

        Show
        Anissa Lam added a comment - Fix checked in on 12/18. Should be available starting from 12/19 nightly build.
        Hide
        shaline added a comment -

        Verified in promoted b38.

        Show
        shaline added a comment - Verified in promoted b38.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: