glassfish
  1. glassfish
  2. GLASSFISH-20372

Globals.get throws unexpected exception IllegalStateException during shutdown

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b85
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Revision 61428 for GLASSFISH-20206 causes WARNING when jmsra is shut down. The reason might be catching MultiException instead of RunLevelException.

      Index: D:/work_dir/glassfish/trunk/all/main/appserver/jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/ActiveJmsResourceAdapter.java
      ===================================================================
      — D:/work_dir/glassfish/trunk/all/main/appserver/jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/ActiveJmsResourceAdapter.java (revision 61427)
      +++ D:/work_dir/glassfish/trunk/all/main/appserver/jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/ActiveJmsResourceAdapter.java (revision 61428)
      @@ -126,9 +126,9 @@
      import org.glassfish.server.ServerEnvironmentImpl;

      import org.jvnet.hk2.annotations.Service;
      +import org.glassfish.hk2.api.MultiException;
      import org.glassfish.hk2.api.PostConstruct;
      import org.glassfish.hk2.api.ServiceLocator;
      -import org.glassfish.hk2.runlevel.RunLevelException;

      import javax.inject.Singleton;
      import org.jvnet.hk2.config.types.Property;
      @@ -402,7 +402,7 @@
      GrizzlyService grizzlyService = null;
      try

      { grizzlyService = Globals.get(GrizzlyService.class); - }

      catch (RunLevelException rle)

      { + }

      catch (MultiException rle)

      { // if GrizzlyService was shut down already, skip removing the proxy. }

      if (grizzlyService != null)

      To reproduce it:

      1. start glassfish
      2. asadmin jms-ping --target server
      3. shut down glassfish

      Then WARNING appears in server.log,

      [2013-04-22T11:13:48.973+0800] [glassfish 4.0] [WARNING] [] [javax.enterprise.resource.jms.com.sun.enterprise.connectors.jms.system] [tid: _ThreadID=133 _ThreadName=Thread-29] [timeMillis: 1366600428973] [levelValue: 900] [[
      Error occurs when shutting down JMSRA: Service com.sun.enterprise.v3.services.impl.GrizzlyService was started at level 0 but it has a run level of 10. The full descriptor is SystemDescriptor(
      implementation=com.sun.enterprise.v3.services.impl.GrizzlyService
      contracts=

      {com.sun.enterprise.v3.services.impl.GrizzlyService,org.glassfish.api.container.RequestDispatcher}
      scope=org.glassfish.hk2.runlevel.RunLevel
      qualifiers={}
      descriptorType=CLASS
      descriptorVisibility=NORMAL
      metadata=runLevelValue={10},Bundle-SymbolicName={org.glassfish.main.core.kernel},Bundle-Version={4.0.0.SNAPSHOT}
      rank=50
      loader=OsgiPopulatorPostProcessor.HK2Loader(OSGiModuleImpl:: Bundle = [org.glassfish.main.core.kernel [192]], State = [READY],9394331)
      proxiable=null
      analysisName=null
      id=690
      locatorId=0
      identityHashCode=16925195
      reified=true)]]

      [2013-04-22T11:13:48.973+0800] [glassfish 4.0] [WARNING] [ra.stop.failed] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=132 _ThreadName=Thread-28] [timeMillis: 1366600428973] [levelValue: 900] [[
      RAR8053: RA [ jmsra ] stop failed, java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.IllegalStateException: Service com.sun.enterprise.v3.services.impl.GrizzlyService was started at level 0 but it has a run level of 10. The full descriptor is SystemDescriptor(
      implementation=com.sun.enterprise.v3.services.impl.GrizzlyService
      contracts={com.sun.enterprise.v3.services.impl.GrizzlyService,org.glassfish.api.container.RequestDispatcher}

      scope=org.glassfish.hk2.runlevel.RunLevel
      qualifiers={}
      descriptorType=CLASS
      descriptorVisibility=NORMAL
      metadata=runLevelValue=

      {10},Bundle-SymbolicName={org.glassfish.main.core.kernel},Bundle-Version={4.0.0.SNAPSHOT}
      rank=50
      loader=OsgiPopulatorPostProcessor.HK2Loader(OSGiModuleImpl:: Bundle = [org.glassfish.main.core.kernel [192]], State = [READY],9394331)
      proxiable=null
      analysisName=null
      id=690
      locatorId=0
      identityHashCode=16925195
      reified=true)]]

      [2013-04-22T11:13:48.974+0800] [glassfish 4.0] [INFO] [] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=132 _ThreadName=Thread-28] [timeMillis: 1366600428974] [levelValue: 800] [[
      shutdown of RA [ jmsra ] is either already complete or already cancelled]]

      [2013-04-22T11:13:48.974+0800] [glassfish 4.0] [WARNING] [ra.stop-unsuccessful] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=132 _ThreadName=Thread-28] [timeMillis: 1366600428974] [levelValue: 900] [[
      RAR7095: jmsra shutdown unsuccessful. Please refer the server and/or resource adapter logs for more information.]]

      *****************************
      StackTrace
      *****************************

      [2013-04-22T20:44:40.836+0800] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=133 _ThreadName=Thread-8] [timeMillis: 1366634680836] [levelValue: 1000] [[
      java.lang.IllegalStateException: Service com.sun.enterprise.v3.services.impl.GrizzlyService was started at level 0 but it has a run level of 10. The full descriptor is SystemDescriptor(
      implementation=com.sun.enterprise.v3.services.impl.GrizzlyService
      contracts={com.sun.enterprise.v3.services.impl.GrizzlyService,org.glassfish.api.container.RequestDispatcher}
      scope=org.glassfish.hk2.runlevel.RunLevel
      qualifiers={}
      descriptorType=CLASS
      descriptorVisibility=NORMAL
      metadata=runLevelValue={10}

      ,Bundle-SymbolicName=

      {org.glassfish.main.core.kernel}

      ,Bundle-Version=

      {4.0.0.SNAPSHOT}

      rank=50
      loader=OsgiPopulatorPostProcessor.HK2Loader(OSGiModuleImpl:: Bundle = [org.glassfish.main.core.kernel [192]], State = [READY],2947307)
      proxiable=null
      analysisName=null
      id=690
      locatorId=0
      identityHashCode=9063159
      reified=true)
      at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.validate(AsyncRunLevelContext.java:228)
      at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:155)
      at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2203)
      at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:579)
      at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:566)
      at org.glassfish.internal.api.Globals.get(Globals.java:86)
      at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.destroy(ActiveJmsResourceAdapter.java:404)
      at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl$RAShutdownTask.run(ResourceAdapterAdminServiceImpl.java:624)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)]]

        Issue Links

          Activity

          Hide
          jwells added a comment -

          This is causing some shutdown processing to not occur which is then in turn causing subsequent reboots of the server to fail.

          Show
          jwells added a comment - This is causing some shutdown processing to not occur which is then in turn causing subsequent reboots of the server to fail.
          Hide
          jwells added a comment -

          What is the impact on the customer of the bug?

          When a customer that has used JMS shuts the server down there will not be a log. This is also possibly causing subsequent reboots to fail, as JMS is not coming down properly.

          What is the cost/risk of fixing the bug?

          Right now several automated testing suites are failing because the server is not shutting down. Hence the risk for not fixing this bug is high. The risk is also very small.

          Is there an impact on documentation or message strings?

          No

          Which tests should QA (re)run to verify the fix did not destabilize GlassFish?

          EJB, Admin, Web

          Which is the targeted build of 4.0 for this fix?

          b88

          If this an integration of a new version of a component from another project,
          what are the changes that are being brought in? This might be list of
          Jira issues from that project or a list of revision messages.

          http://gf-hudson.us.oracle.com/hudson/job/promote-hk2/185/changes
          https://java.net/jira/browse/HK2-110

          There is also a minor performance change in this set of changes

          Show
          jwells added a comment - What is the impact on the customer of the bug? When a customer that has used JMS shuts the server down there will not be a log. This is also possibly causing subsequent reboots to fail, as JMS is not coming down properly. What is the cost/risk of fixing the bug? Right now several automated testing suites are failing because the server is not shutting down. Hence the risk for not fixing this bug is high. The risk is also very small. Is there an impact on documentation or message strings? No Which tests should QA (re)run to verify the fix did not destabilize GlassFish? EJB, Admin, Web Which is the targeted build of 4.0 for this fix? b88 If this an integration of a new version of a component from another project, what are the changes that are being brought in? This might be list of Jira issues from that project or a list of revision messages. http://gf-hudson.us.oracle.com/hudson/job/promote-hk2/185/changes https://java.net/jira/browse/HK2-110 There is also a minor performance change in this set of changes
          Hide
          Tom Mueller added a comment -

          Approved for 4.0. However, I don't see the connection between this failure and subsequent server starts. Please explain that.

          Show
          Tom Mueller added a comment - Approved for 4.0. However, I don't see the connection between this failure and subsequent server starts. Please explain that.
          Hide
          jwells added a comment -

          The explanation is that since JMS is not shutting down properly it is possible it is holding file descriptors for transaction logs or network descriptors. If the next server process boots prior to the last one truly shutting down it is possible that there could be an issue booting the next server. However, I have not observed this myself, nor do I have any proof. So... it is just a theory!

          Show
          jwells added a comment - The explanation is that since JMS is not shutting down properly it is possible it is holding file descriptors for transaction logs or network descriptors. If the next server process boots prior to the last one truly shutting down it is possible that there could be an issue booting the next server. However, I have not observed this myself, nor do I have any proof. So... it is just a theory!
          Hide
          jwells added a comment -

          Fixed at change 61595

          Show
          jwells added a comment - Fixed at change 61595

            People

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

              Dates

              • Created:
                Updated:
                Resolved: