7 Replies Latest reply on Oct 20, 2011 3:29 AM by ivannushev

    close jms conection cause block

    zxj518

      it is threaddump base on jboss 5.1 and JBM 1.4.3

      "WorkerThread#207[127.0.0.1:4778]" - Thread t@20663
      java.lang.Thread.State: BLOCKED on org.jboss.jms.server.connectionmanager.SimpleConnectionManager@11fef77 owned by: Timer-12
      at org.jboss.jms.server.connectionmanager.SimpleConnectionManager.unregisterConnection(SimpleConnectionManager.java:147)
      at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.close(ServerConnectionEndpoint.java:440)
      at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$close$aop(ConnectionAdvised.java:63)
      at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$close_N4742752445160157748.invokeTarget(ConnectionAdvised$close_N4742752445160157748.java)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
      at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.close(ConnectionAdvised.java)
      at org.jboss.jms.wireformat.CloseRequest.serverInvoke(CloseRequest.java:66)
      at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:143)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
      - locked org.jboss.remoting.transport.socket.ServerThread@1236b96
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)

      Locked ownable synchronizers:
      - None

      "WorkerThread#206[10.133.249.58:4076]" - Thread t@20640
      java.lang.Thread.State: RUNNABLE
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
      - locked java.io.BufferedInputStream@2fc94a
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at org.jboss.remoting.transport.socket.ServerThread.readVersion(ServerThread.java:1038)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:673)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)

      Locked ownable synchronizers:
      - None

      "WorkerThread#205[10.133.249.58:3067]" - Thread t@20639
      java.lang.Thread.State: BLOCKED on org.jboss.jms.server.connectionmanager.SimpleConnectionManager@11fef77 owned by: Timer-12
      at org.jboss.jms.server.connectionmanager.SimpleConnectionManager.registerConnection(SimpleConnectionManager.java:104)
      at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.(ServerConnectionEndpoint.java:196)
      at org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegateInternal(ServerConnectionFactoryEndpoint.java:273)
      at org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegate(ServerConnectionFactoryEndpoint.java:171)
      at org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.org$jboss$jms$server$endpoint$advised$ConnectionFactoryAdvised$createConnectionDelegate$aop(ConnectionFactoryAdvised.java:108)
      at org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.createConnectionDelegate(ConnectionFactoryAdvised.java)
      at org.jboss.jms.wireformat.ConnectionFactoryCreateConnectionDelegateRequest.serverInvoke(ConnectionFactoryCreateConnectionDelegateRequest.java:91)
      at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:143)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
      - locked org.jboss.remoting.transport.socket.ServerThread@1417c05
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)

      Locked ownable synchronizers:
      - None

      "WorkerThread#204[10.133.249.22:33885]" - Thread t@20638
      java.lang.Thread.State: RUNNABLE
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
      - locked java.io.BufferedInputStream@15e5e0d
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at org.jboss.remoting.transport.socket.ServerThread.readVersion(ServerThread.java:1038)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:673)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)

      Locked ownable synchronizers:
      - None

      "Timer-12" - Thread t@19961
      java.lang.Thread.State: WAITING on java.util.LinkedList@1b71452
      at java.lang.Object.wait(Native Method)
      at java.lang.Object.wait(Object.java:485)
      at org.jboss.messaging.util.OrderedExecutorFactory$ChildExecutor.shutdownAfterProcessingCurrentlyQueuedTasks(OrderedExecutorFactory.java:164)
      at org.jboss.jms.server.endpoint.ServerSessionEndpoint.localClose(ServerSessionEndpoint.java:1229)
      at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.close(ServerConnectionEndpoint.java:388)
      at org.jboss.jms.server.connectionmanager.SimpleConnectionManager.cleanupForSessionID(SimpleConnectionManager.java:465)
      at org.jboss.jms.server.connectionmanager.SimpleConnectionManager.handleClientFailure(SimpleConnectionManager.java:200)
      - locked org.jboss.jms.server.connectionmanager.SimpleConnectionManager@11fef77
      at org.jboss.jms.server.connectionmanager.SimpleConnectionManager.handleConnectionException(SimpleConnectionManager.java:237)
      at org.jboss.remoting.ConnectionNotifier.connectionLost(ConnectionNotifier.java:59)
      at org.jboss.remoting.Lease.notifyClientLost(Lease.java:211)
      at org.jboss.remoting.Lease.access$500(Lease.java:39)
      at org.jboss.remoting.Lease$LeaseTimerTask.run(Lease.java:250)
      at java.util.TimerThread.mainLoop(Timer.java:512)
      at java.util.TimerThread.run(Timer.java:462)

        • 1. Re: close jms conection cause block
          gaohoward

          Hi,

          JBM 1.4.3 is fairly old release. I suggest you try 1.4.6.GA and see if the problem exists. Then we can continue the investigation. Thanks!

          Howard

          • 2. Re: close jms conection cause block
            zxj518

            How can i get 1.4.6.GA For AS 5.1. Can you give me a link? Or Only complie from svn?

            • 3. Re: close jms conection cause block
              gaohoward

              http://anonsvn.jboss.org/repos/messaging/tags/JBossMessaging_1_4_6_GA/

              You need to build yourself.

              Of course if you have EAP 5, it's already in the package.

              • 4. Re: close jms conection cause block
                ivannushev

                I use JBoss 5.1.0 and had similar problem as the one described above. Then I pached it with JBoss Messaging 1.4.6.GA-SP1 and JBoss Remoting 2.5.3.SP1 following the recommendation. But the problem occurred again. The consequnce to the blocked thread is that any server call to a specific MDB is blocked and a message is logged: "Unable to passivate due to ctx lock...".  A jmx-console thread dump fragment is copied below.

                Any help or hint is appreciated. Thanks.

                 

                Thread: http-0.0.0.0-443-3 : priority:5, demon:true, threadId:129, threadState:BLOCKED

                 

                    - waiting on <0x9af2a2> (a org.jboss.jms.server.connectionmanager.SimpleConnectionManager)

                    org.jboss.jms.server.connectionmanager.SimpleConnectionManager.registerConnection(SimpleConnectionManager.java:104)

                    org.jboss.jms.server.endpoint.ServerConnectionEndpoint.(ServerConnectionEndpoint.java:196)

                    org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegateInternal(ServerConnectionFactoryEndpoint.java:270)

                    org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegate(ServerConnectionFactoryEndpoint.java:170)

                    org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.org$jboss$jms$server$endpoint$advised$ConnectionFactoryAdvised$createConnectionDelegate$aop(ConnectionFactoryAdvised.java:108)

                    org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.createConnectionDelegate(ConnectionFactoryAdvised.java)

                    org.jboss.jms.wireformat.ConnectionFactoryCreateConnectionDelegateRequest.serverInvoke(ConnectionFactoryCreateConnectionDelegateRequest.java:91)

                    org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:157)

                    org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:930)

                    org.jboss.remoting.transport.servlet.ServletServerInvoker.processRequest(ServletServerInvoker.java:416)

                    org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.processRequest(ServerInvokerServlet.java:404)

                    org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.processRequest(ServerInvokerServlet.java:142)

                    org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.doPost(ServerInvokerServlet.java:171)

                    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

                    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

                    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

                    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

                    org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

                    org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

                    org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

                    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                    org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

                    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

                    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

                    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

                    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

                    java.lang.Thread.run(Thread.java:619)

                 

                Thread: http-0.0.0.0-443-4 : priority:5, demon:true, threadId:131, threadState:BLOCKED

                 

                    - waiting on <0x9af2a2> (a org.jboss.jms.server.connectionmanager.SimpleConnectionManager)

                    org.jboss.jms.server.connectionmanager.SimpleConnectionManager.registerConnection(SimpleConnectionManager.java:104)

                    org.jboss.jms.server.endpoint.ServerConnectionEndpoint.(ServerConnectionEndpoint.java:196)

                    org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegateInternal(ServerConnectionFactoryEndpoint.java:270)

                    org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegate(ServerConnectionFactoryEndpoint.java:170)

                    org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.org$jboss$jms$server$endpoint$advised$ConnectionFactoryAdvised$createConnectionDelegate$aop(ConnectionFactoryAdvised.java:108)

                    org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.createConnectionDelegate(ConnectionFactoryAdvised.java)

                    org.jboss.jms.wireformat.ConnectionFactoryCreateConnectionDelegateRequest.serverInvoke(ConnectionFactoryCreateConnectionDelegateRequest.java:91)

                    org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:157)

                    org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:930)

                    org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)

                    org.jboss.remoting.Client.invoke(Client.java:2034)

                    org.jboss.remoting.Client.invoke(Client.java:877)

                    org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:178)

                    org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeTarget(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)

                    org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:80)

                    org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect_z_handleCreateConnectionDelegate_27508725.invoke(StateCreationAspect_z_handleCreateConnectionDelegate_27508725.java)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)

                    org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)

                    org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)

                    org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)

                    com.company.messageservice.server.bean.BusinessEventRegistrarBean.ejbCreate(BusinessEventRegistrarBean.java:80)

                    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    java.lang.reflect.Method.invoke(Method.java:597)

                    org.jboss.ejb.StatelessSessionEnterpriseContext.(StatelessSessionEnterpriseContext.java:83)

                    org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:49)

                    org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:179)

                    org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:94)

                    org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)

                    org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)

                    org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)

                    org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161)

                    org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:230)

                    org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:205)

                    org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:99)

                    org.jboss.ejb.plugins.security.PreSecurityInterceptor.invokeHome(PreSecurityInterceptor.java:88)

                    org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)

                    org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)

                    org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:639)

                    org.jboss.ejb.Container.invoke(Container.java:1046)

                    sun.reflect.GeneratedMethodAccessor452.invoke(Unknown Source)

                    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    java.lang.reflect.Method.invoke(Method.java:597)

                    org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

                    org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

                    org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

                    org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

                    org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

                    org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)

                    org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)

                    org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)

                    org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)

                    org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)

                    org.jboss.proxy.ejb.SecurityContextInterceptor.invoke(SecurityContextInterceptor.java:64)

                    org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:68)

                    org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)

                    org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)

                    $Proxy390.create(Unknown Source)

                    com.company.messageservice.server.BusinessEventRegistrarClient.getBusinessEventRegistrar(BusinessEventRegistrarClient.java:41)

                    com.company.messageservice.server.BusinessEventRegistrarClient.registerBusinessEvent(BusinessEventRegistrarClient.java:53)

                    com.company.doc.bean.DocEJB.registerEvent(DocEJB.java:967)

                    com.company.doc.bean.DocEJB.save(DocEJB.java:790)

                    sun.reflect.GeneratedMethodAccessor849.invoke(Unknown Source)

                    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    java.lang.reflect.Method.invoke(Method.java:597)

                    org.jboss.invocation.Invocation.performCall(Invocation.java:386)

                    org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:606)

                    org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor.invoke(StatefulSessionSecurityInterceptor.java:84)

                    org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

                    org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)

                    org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

                    org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:348)

                    org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

                    org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

                    org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)

                    org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)

                    org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:97)

                    org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:81)

                    org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)

                    org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)

                    org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)

                    org.jboss.ejb.Container.invoke(Container.java:1029)

                    sun.reflect.GeneratedMethodAccessor452.invoke(Unknown Source)

                    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    java.lang.reflect.Method.invoke(Method.java:597)

                    org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

                    org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

                    org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

                    org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

                    org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

                    org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)

                    org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)

                    org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)

                    org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)

                    org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)

                    org.jboss.proxy.ejb.SecurityContextInterceptor.invoke(SecurityContextInterceptor.java:64)

                    org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:68)

                    org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:118)

                    org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)

                    $Proxy342.save(Unknown Source)

                    com.company.doc.DocClient.save(DocClient.java:1575)

                    com.company.doc.server.DocManagerImpl.saveDocuments(DocManagerImpl.java:134)

                    com.company.server.bean.DocServiceEJB.saveDocuments(DocServiceEJB.java:425)

                    sun.reflect.GeneratedMethodAccessor848.invoke(Unknown Source)

                    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    java.lang.reflect.Method.invoke(Method.java:597)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)

                    org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)

                    org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)

                    org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)

                    sun.reflect.GeneratedMethodAccessor678.invoke(Unknown Source)

                    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    java.lang.reflect.Method.invoke(Method.java:597)

                    org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)

                    org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_27508725.invoke(InvocationContextInterceptor_z_fillMethod_27508725.java)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)

                    org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_27508725.invoke(InvocationContextInterceptor_z_setup_27508725.java)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:60)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)

                    org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

                    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                    org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:571)

                    org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)

                    org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)

                    org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)

                    org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:930)

                    org.jboss.remoting.transport.servlet.ServletServerInvoker.processRequest(ServletServerInvoker.java:416)

                    org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.processRequest(ServerInvokerServlet.java:404)

                    org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.processRequest(ServerInvokerServlet.java:142)

                    org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.doPost(ServerInvokerServlet.java:171)

                    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

                    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

                    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

                    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

                    org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

                    org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

                    org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

                    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                    org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

                    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

                    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

                    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

                    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

                    java.lang.Thread.run(Thread.java:619)

                • 5. Re: close jms conection cause block
                  ivannushev

                  Hi all. I've fixed my blocking problem. I'm exposing below how I overcome it.

                  First of all, the blocking issue wasn't in JBoss Messaging itself, but in the way I used it. That's why I have to explain a bit more about my use case. Our business needs supposed to have multiple subscribers interesting in a set of business events. Events are fired when some business objects are modified. Then subscribers are notified about these changes and they take appropriate actions. These business needs were designed to be fulfilled as using a chain of JMS destinations. Business events are registered to the first JMS destination by a SLSB. Then a MDB consumes them and based on existing subscriptions decides whether to publish business messages to the second JMS destination (of type Topic because it has to notify multiple subscribers). That design was chosen in order to make processing of events to happen asynchronously from their generation and to eliminate delay when events are turned into business messages. Moreover publishing of business events and their consuming was put in distributed transaction management.

                  So the first JMS misuse was that the business event destination (the first one of the chain) was of type Queue. As JMS documentation states in case of chaining all destinations have to be of same type. The second design misuse was that both destinations don't know about each other: as JBoss Messaging examples exposes, in case of chaining the second destination have to be set as JMSReplyTo property to each message (this is not a proper JMS requirement and I suppose it is needed in order JBM to make appropriate synchronization of JMS resources). I turn the JMS Queue into JMS Topic because the second destination is to be Topic for our business needs. As its messages are consumed by a MDB, then a durable subscription has to be done for it.

                  There was a chance to have JMS resource leaking because I implemented JMS resource reusing inside SLSB-s responsible for JMS message publishing following the tutorial examples and that's why I remove that i.e. JMS resources are obtained and released for each call.

                  I have to mention our business needs requires to use HTTPS for transport protocol and that's why SSLServlet remoting transport was chosen for JMS. This circumstance added a lot complications to the service because that transport is unidirectional, initiated from clients to the server and not so reliable as the practice showed. I still haven't found reliable JMS configuration for SSLServlet transport which makes JMS MessageListener-s (subscribed to the second Topic in our case) to survive 'forever': I mean that somehow they stop receiving messages, their subscription is seen in jmx-console, but it is registered that some number of messages are not delivered (117 is the number of not delivered messages):

                  Topic,Subscription.ir5-t38dfnog-1-en8m8nog-76nur7-x305o4c5,-,false,0,0,117,117,-

                  I attach the configuration file asking for hints what settings could be wrong. Thanks.

                   

                  <mbean code="org.jboss.remoting.transport.Connector"

                      name="jboss.remoting:service=connector,transport=sslservlet,target=jms,loc=public"

                      display-name="JMS Public Servlet transport Connector">

                      <attribute name="Configuration">

                          <config>

                              <invoker transport="sslservlet">

                                  <!--

                                      There should be no reason to change these parameters - warning!

                                      Changing them may stop JBoss Messaging working correctly

                                  -->

                                  <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>

                                  <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>

                                  <attribute name="dataType" isParam="true">jms</attribute>

                                  <attribute name="serverBindAddress">${jboss.bind.address}</attribute>

                                  <attribute name="serverBindPort">443</attribute>

                                  <attribute name="clientConnectAddress">${public.firewall.address}</attribute>

                                  <attribute name="clientConnectPort">443</attribute>

                                  <attribute name="numberOfCallRetries" isParam="true">3</attribute>

                                  <attribute name="pingFrequency" isParam="true">1200000</attribute>

                                  <attribute name="pingWindowFactor" isParam="true">2</attribute>

                                  <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>

                                  <attribute name="callbackStore">org.jboss.remoting.callback.BlockingCallbackStore</attribute>

                                  <attribute name="unwrapSingletonArrays">true</attribute>

                                  <attribute name="path">unified-invoker/PublicJmsServerInvokerServlet</attribute>

                                  <attribute name="return-exception">true</attribute>

                                  <attribute name="createUniqueObjectName">true</attribute>

                                  <attribute name="useAllParams" isParam="true">true</attribute>

                                  <!-- End immutable parameters -->

                   

                                  <attribute name="generalizeSocketException" isParam="true">true</attribute>

                                  <attribute name="callbackErrorsAllowed">1</attribute>

                                  <attribute name="stopLeaseOnFailure" isParam="true">true</attribute>

                                  <attribute name="socketTimeout" isParam="true">120000</attribute>

                                  <attribute name="writeTimeout" isParam="true">30000</attribute>

                   

                                  <attribute name="callbackTimeout" isParam="true">10000</attribute>

                                  <attribute name="JBM_clientMaxPoolSize" isParam="true">200</attribute>

                                  <attribute name="maxPoolSize" isParam="true">300</attribute>

                   

                                  <!--

                                      Periodicity of client pings. Server window by default is twice this

                                      figure

                                  -->

                                  <attribute name="clientLeasePeriod" isParam="true">50000</attribute>

                                  <attribute name="validatorPingPeriod" isParam="true">50000</attribute>

                                  <attribute name="validatorPingTimeout" isParam="true">25000</attribute>

                                  <attribute name="registerCallbackListener" isParam="true">true</attribute>

                   

                                  <attribute name="timeout" isParam="true">3600000</attribute>

                                  <attribute name="continueAfterTimeout" isParam="true">false</attribute>

                                  <!--

                                      Set this to true if you want the servlet transport to block waiting

                                      for server->client traffic. Or false if you want it to poll for new

                                      traffic periodically. Recommended is blocking

                                  -->

                                  <attribute name="blockingMode" isParam="true">blocking</attribute>

                   

                                  <!--

                                      Timeout for blocking. Only has relevance if blockingMode = blocking

                                  -->

                                  <attribute name="blockingTimeout" isParam="true">30000</attribute>

                   

                                  <!--

                                      The periodicity of polling. Only has relevance if blockingMode =

                                      nonblocking

                                  -->

                                  <!--

                                      attribute name="callbackPollPeriod" isParam="true">10000</attribute

                                  -->

                              </invoker>

                              <handlers>

                                  <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>

                              </handlers>

                          </config>

                      </attribute>

                  </mbean>

                  • 6. Re: close jms conection cause block
                    ivannushev

                    Hi all. Just to add that I succeeded to make remote JMS MessageListeners reliable using sslservlet remoting transport. To achieve this goal I use the remoting servlet configuration packed in JBM 1.4.6.GA.SP1:

                    http://anonsvn.jboss.org/repos/messaging/tags/JBossMessaging_1_4_6_GA_SP1/integration/AS5/etc/remoting/remoting-servlet-service.xml

                    plus a few settings for SSL flavour and a JMS Connection' javax.jms.ExceptionListener which recreate the JMS Connection and Topic subscription in case of connection exception. I attach the exact configuration used:

                     

                    <mbean code="org.jboss.remoting.transport.Connector"

                        name="jboss.remoting:service=connector,transport=sslservlet,target=jms,loc=public"

                        display-name="JMS Public Servlet transport Connector">

                        <attribute name="Configuration">

                            <config>

                                <invoker transport="sslservlet">

                                    <!-- There should be no reason to change these parameters - warning!

                                        Changing them may stop JBoss Messaging working correctly -->

                                    <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>

                                    <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>

                                    <attribute name="dataType" isParam="true">jms</attribute>

                                    <attribute name="serverBindAddress">${jboss.bind.address}</attribute>

                                    <attribute name="serverBindPort">443</attribute>

                                    <attribute name="clientConnectAddress">${public.firewall.address}</attribute>

                                    <attribute name="clientConnectPort">443</attribute>

                                    <attribute name="numberOfCallRetries" isParam="true">1</attribute>

                                    <attribute name="pingFrequency" isParam="true">214748364</attribute>

                                    <attribute name="pingWindowFactor" isParam="true">10</attribute>

                                    <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>

                                    <attribute name="callbackStore">org.jboss.remoting.callback.BlockingCallbackStore</attribute>

                                    <attribute name="unwrapSingletonArrays">true</attribute>

                                    <attribute name="path">unified-invoker/PublicJmsServerInvokerServlet</attribute>

                                    <attribute name="return-exception">true</attribute>

                                    <attribute name="createUniqueObjectName">true</attribute>

                                    <attribute name="useAllParams" isParam="true">true</attribute>

                                    <!-- End immutable parameters -->

                     

                                    <attribute name="stopLeaseOnFailure" isParam="true">true</attribute>

                     

                                    <!-- Periodicity of client pings. Server window by default is twice this figure -->

                                    <attribute name="clientLeasePeriod" isParam="true">10000</attribute>

                                    <attribute name="validatorPingPeriod" isParam="true">10000</attribute>

                                    <attribute name="validatorPingTimeout" isParam="true">5000</attribute>

                     

                                    <attribute name="failureDisconnectTimeout" isParam="true">0</attribute>

                                    <attribute name="callbackErrorsAllowed">1</attribute>

                                    <attribute name="registerCallbackListener">false</attribute>

                                    <attribute name="useClientConnectionIdentity" isParam="true">true

                                    </attribute>

                     

                                    <attribute name="timeout" isParam="true">0</attribute>

                     

                                    <!-- Max Number of connections in client pool. This should be significantly

                                        higher than the max number of sessions/consumers you expect -->

                                    <attribute name="JBM_clientMaxPoolSize" isParam="true">200</attribute>

                     

                                    <!-- Set this to true if you want the servlet transport to block waiting

                                        for server->client traffic. Or false if you want it to poll for new traffic

                                        periodically. Recommended is blocking -->

                                    <attribute name="blockingMode" isParam="true">blocking</attribute>

                     

                                    <!-- Timeout for blocking. Only has relevance if blockingMode = blocking -->

                                    <attribute name="blockingTimeout" isParam="true">30000</attribute>

                     

                                    <!-- The periodicity of polling. Only has relevance if blockingMode = nonblocking -->

                                    <!--attribute name="callbackPollPeriod" isParam="true">10000</attribute -->

                                </invoker>

                                <handlers>

                                    <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler

                                    </handler>

                                </handlers>

                            </config>

                        </attribute>

                    </mbean>

                    • 7. Re: close jms conection cause block
                      ivannushev

                      Fos sake of correctness let me add that JMS Connection' javax.jms.ExceptionListener should not re-create client JMS Connection; it is to notify the client the JMS Connection is broken and to return fast. It is a responsibility of the client to close JMS resources and to try to re-create them.