4 Replies Latest reply on Feb 25, 2004 7:51 PM by maksimus

    How to correctly perform cleanup of StdServerSessionPool?

    maksimus Newbie

      I'm integrating propriatary JMS implementation with JBoss. The only problem that I'm facing is that JBoss hangs on shutdown. I've found that it happens at StdServerSessionPool.clear method at sessionPool.wait() call.

      //wait for all server sessions to be returned.
      synchronized (sessionPool)
      {
      while (numServerSessions > 0)
      {
      try
      {
      sessionPool.wait();
      }
      catch (InterruptedException ignore)
      {
      }
      }
      }

      It looks like JMS I'm using does not return server sessions correctly or doesn't notify about their return.

      What is the API that should be called to correctly return server session?

      Here is the full stack of Shutdown Hook thread:

      Thread [JBoss Shutdown Hook] (Suspended)
      java.lang.Object.wait(long) line: not available [native method]
      java.util.ArrayList(java.lang.Object).wait() line: 429
      org.jboss.jms.asf.StdServerSessionPool.clear() line: 251
      org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStop() line: 770
      org.jboss.ejb.plugins.jms.JMSContainerInvoker.stopService() line: 710
      org.jboss.ejb.plugins.jms.JMSContainerInvoker(org.jboss.system.ServiceMBeanSupport).stop() line: 240
      org.jboss.ejb.MessageDrivenContainer.stopService() line: 273
      org.jboss.ejb.MessageDrivenContainer(org.jboss.system.ServiceMBeanSupport).stop() line: 240
      sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]
      sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 39
      sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25
      java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) line: 324
      org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) line: 284
      org.jboss.mx.server.MBeanServerImpl.invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], java.lang.String[]) line: 546
      org.jboss.system.ServiceController$ServiceProxy.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) line: 976
      $Proxy14.stop() line: not available
      org.jboss.system.ServiceController.stop(javax.management.ObjectName) line: 471
      sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]
      sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 39
      sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25
      java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) line: 324
      org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) line: 284
      org.jboss.mx.server.MBeanServerImpl.invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], java.lang.String[]) line: 546
      org.jboss.mx.util.MBeanProxyExt.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) line: 177
      $Proxy29.stop(javax.management.ObjectName) line: not available
      org.jboss.ejb.EjbModule.stopService() line: 350
      org.jboss.ejb.EjbModule(org.jboss.system.ServiceMBeanSupport).stop() line: 240
      sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]
      sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 39
      sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25
      java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) line: 324
      org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) line: 284
      org.jboss.mx.server.MBeanServerImpl.invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], java.lang.String[]) line: 546
      org.jboss.system.ServiceController$ServiceProxy.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) line: 976
      $Proxy14.stop() line: not available
      org.jboss.system.ServiceController.stop(javax.management.ObjectName) line: 471
      sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]
      sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 39
      sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25
      java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) line: 324
      org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) line: 284
      org.jboss.mx.server.MBeanServerImpl.invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], java.lang.String[]) line: 546
      org.jboss.mx.util.MBeanProxyExt.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) line: 177
      $Proxy12.stop(javax.management.ObjectName) line: not available
      org.jboss.ejb.EJBDeployer.stop(org.jboss.deployment.DeploymentInfo) line: 567
      org.jboss.deployment.MainDeployer.stop(org.jboss.deployment.DeploymentInfo) line: 489
      org.jboss.deployment.MainDeployer.undeploy(org.jboss.deployment.DeploymentInfo, boolean) line: 472
      org.jboss.deployment.MainDeployer.shutdown() line: 359
      sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]
      sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 39
      sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25
      java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) line: 324
      org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(java.lang.String, java.lang.Object[], java.lang.String[]) line: 284
      org.jboss.mx.server.MBeanServerImpl.invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], java.lang.String[]) line: 546
      org.jboss.system.server.ServerImpl$ShutdownHook.shutdownDeployments() line: 849
      org.jboss.system.server.ServerImpl$ShutdownHook.shutdown() line: 824
      org.jboss.system.server.ServerImpl$ShutdownHook.run() line: 812