glassfish
  1. glassfish
  2. GLASSFISH-20810

NPE will be thrown to the server.log when save the default value of Availability Service page

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.1
    • Component/s: admin_gui, rest-interface
    • Labels:
      None
    • Environment:

      All

      Description

      Here's my reproduced steps:
      1). start the domain
      2). login the admin console
      3). Access to the Avaliable Service page under default-config.
      4). Type the Web Conatiner Availability page and save the default setting
      5). Error in saving the default setting
      6). The NPE will be thrown to the server.log, here's the stacktrace:

      [2013-09-12T16:47:17.532+0800] [glassfish 4.0] [INFO] [NCLS-REST-00003] [javax.enterprise.admin.rest] [tid: _ThreadID=124 _ThreadName=admin-listener(6)] [timeMillis: 1378975637532] [levelValue: 800] [[
        An error occurred while processing the request. Please see the server logs for details.
      java.lang.NullPointerException
      	at org.glassfish.admin.rest.resources.PropertiesBagResource.setParentAndTagName(PropertiesBagResource.java:265)
      	at org.glassfish.admin.rest.resources.generatedASM.WebContainerAvailabilityResource.getPropertiesBagResource(Unknown Source)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.glassfish.jersey.server.internal.routing.SubResourceLocatorRouter$2.run(SubResourceLocatorRouter.java:228)
      	at org.glassfish.jersey.server.internal.routing.SubResourceLocatorRouter.getResource(SubResourceLocatorRouter.java:245)
      	at org.glassfish.jersey.server.internal.routing.SubResourceLocatorRouter.apply(SubResourceLocatorRouter.java:132)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:120)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:123)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:104)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:63)
      	at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
      	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:228)
      	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
      	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
      	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:318)
      	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:211)
      	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:982)
      	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:330)
      	at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:316)
      	at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:179)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
      	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      ]]
      

      Once the NPE was thrown out, All of the operation related to the Availability Service page are useless. So I think it is a critical issue need to be fix as soon as possible.

        Issue Links

          Activity

          Hide
          Jeremy_Lv added a comment -

          Hi, Anissa:

          I found this phenomenon can't be reproduced in the glassfish v3.1.2.2 right now, So I marked this issue as a 4.0-regression issue and need to be resolved! I will take some times to do some investigation about this failure soon.

          Thanks

          Show
          Jeremy_Lv added a comment - Hi, Anissa: I found this phenomenon can't be reproduced in the glassfish v3.1.2.2 right now, So I marked this issue as a 4.0-regression issue and need to be resolved! I will take some times to do some investigation about this failure soon. Thanks
          Hide
          Jeremy_Lv added a comment -

          After compared the PropertiesBagResource.java with glassfish v3's source, I have found the the PropertiesBagResource.setParentAndTagName has a null check there.

          Here's the V3's code:

          public void setParentAndTagName(Dom parent, String tagName) {
                  if(parent == null) {
                      return;
                  }
                  this.parent = parent;
                  this.tagName = tagName;
                  entity = parent.nodeElements(tagName);
              }
          

          I hope anyone can help me to confirm about this.

          Thanks

          Show
          Jeremy_Lv added a comment - After compared the PropertiesBagResource.java with glassfish v3's source, I have found the the PropertiesBagResource.setParentAndTagName has a null check there. Here's the V3's code: public void setParentAndTagName(Dom parent, String tagName) { if (parent == null ) { return ; } this .parent = parent; this .tagName = tagName; entity = parent.nodeElements(tagName); } I hope anyone can help me to confirm about this. Thanks
          Hide
          Jeremy_Lv added a comment -

          this issue is similar to GLASSFISH-18354

          Show
          Jeremy_Lv added a comment - this issue is similar to GLASSFISH-18354
          Hide
          Jeremy_Lv added a comment -

          Although the NPE won't be thrown out after add a null check there, the property setting about the availability Service can't be saved successfully.

          So the issue is still exist. Need to fix about this.

          Show
          Jeremy_Lv added a comment - Although the NPE won't be thrown out after add a null check there, the property setting about the availability Service can't be saved successfully. So the issue is still exist. Need to fix about this.
          Hide
          Jeremy_Lv added a comment -

          Some of the error messages are as follows:

          [2013-09-12T18:34:40.751+0800] [glassfish 4.0] [SEVERE] [] [org.glassfish.admingui] [tid: _ThreadID=43 _ThreadName=admin-listener(1)] [timeMillis: 1378982080751] [levelValue: 1000] [[
            RestResponse.getResponse() gives FAILURE.  endpoint = 'http://localhost:4848/management/domain/configs/config/default-config/availability-service/ejb-container-availability.json'; attrs = '{}']]
          
          Show
          Jeremy_Lv added a comment - Some of the error messages are as follows: [2013-09-12T18:34:40.751+0800] [glassfish 4.0] [SEVERE] [] [org.glassfish.admingui] [tid: _ThreadID=43 _ThreadName=admin-listener(1)] [timeMillis: 1378982080751] [levelValue: 1000] [[ RestResponse.getResponse() gives FAILURE. endpoint = 'http: //localhost:4848/management/domain/configs/config/ default -config/availability-service/ejb-container-availability.json'; attrs = '{}']]
          Hide
          Anissa Lam added a comment -

          It is not just affecting the default-config, but any config referenced by cluster.
          Once the error occurs, you get the error in

          web container availability tab
          ejb container availability tab
          jms availability.
          when you just want to go to that tab. ie, the error occurs when displaying that tab.
          further more, the error persist even AFTER a server restart.

          We should try to fix this for 4.0.1.

          Show
          Anissa Lam added a comment - It is not just affecting the default-config, but any config referenced by cluster. Once the error occurs, you get the error in web container availability tab ejb container availability tab jms availability. when you just want to go to that tab. ie, the error occurs when displaying that tab. further more, the error persist even AFTER a server restart. We should try to fix this for 4.0.1.
          Hide
          Anissa Lam added a comment -

          This is a REST issue, request Jason to work on it.

          Show
          Anissa Lam added a comment - This is a REST issue, request Jason to work on it.
          Hide
          Jason Lee added a comment -

          I think I've found a fix for this. Testing is in progress.

          Show
          Jason Lee added a comment - I think I've found a fix for this. Testing is in progress.
          Hide
          Jason Lee added a comment -

          Fix and test committed (r63336)

          Show
          Jason Lee added a comment - Fix and test committed (r63336)

            People

            • Assignee:
              Jason Lee
              Reporter:
              Jeremy_Lv
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: