1 Reply Latest reply on Aug 26, 2010 8:09 PM by gaohoward

    Identifying session status before performing actions on it

    newway

      Hello,

       

      I'm trying to see if I can implement a solution to a problem that I have, but if you think I'm looking in the wrong direction - please let me know.

       

      this is a description of my system:

       

      on the server side I have :

      1. JBOSS 4.2.3.GA for java 6
      2. with JBOSS Messaging 1.4.5.GA
      3. and remoting 2.2.3.sp1

       

      i have multiple clients that run as follows:

      1. a process run using Java Service Wrapper by Tanuki
      2. java code that connect to the server using JNDI lookup
      3. CPP code activated through JNI.

       

      the clients receive message from the server and process them in the cpp code and we tracked a bug that we have to the fact that multiple clients are handling the same message.

       

      after some digging up it looks like the connection to client A is lost after it receives the message and starts handling it and so the JMS redelivers the message to client B.

       

      when client A tries to commit is response to the session we get an exception, but it's too late since the cpp part already committed it's work.

       

      so what I wanted to know is if there is a way to query a session and see that it's still valid, or if you have an explanation as to why the connection is lost and what I need to do to prevent this.

       

      Here are some of the messages we get -

       

      Server side:

      2010-08-16 16:10:35,468 DEBUG [org.jboss.remoting.ConnectionNotifier] org.jboss.remoting.ConnectionNotifier@d77a85 Server connection lost to client (session id = 3m3b533o-il79jy-gcxc7el5-1-gcxc7fmx-4

      2010-08-16 16:10:35,468 DEBUG [org.jboss.jms.server.remoting.JMSServerInvocationHandler] removing callback handler ServerInvokerCallbackHandler[3m3b533o-il79jy-gcxc7el5-1-gcxc7fmx-4+3m3b533o-il79jy-gcxc7el5-1-gcxc7ip5-b]

      2010-08-16 16:10:35,468 DEBUG [org.jboss.remoting.InvokerRegistry] removed SocketClientInvoker[11455a2, bisocket://x.x.x.x:657877203] from registry

      2010-08-16 16:10:35,468 DEBUG [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] SocketClientInvoker[11455a2, bisocket://x.x.x.x:657877203] disconnecting ...

      2010-08-16 16:10:35,468 DEBUG [org.jboss.remoting.Client] Client[10883757:3m3b533o-il79jy-gcxc7el5-1-gcxc7fmx-4+3m3b533o-il79jy-gcxc7el5-1-gcxc7ip5-b] is disconnected

      2010-08-16 16:10:35,468 DEBUG [org.jboss.remoting.callback.ServerInvokerCallbackHandler] ServerInvokerCallbackHandler[3m3b533o-il79jy-gcxc7el5-1-gcxc7fmx-4+3m3b533o-il79jy-gcxc7el5-1-gcxc7ip5-b] shut down

       

      2010-08-16 16:10:36,171 DEBUG [org.jboss.jms.server.connectionmanager.SimpleConnectionManager] unregistered connection ConnectionEndpoint[w-ekj7cxcg-1-90c6cxcg-vn8ywe-o335b3m3] with remoting session ID ...-gcxc7fmx-4

      2010-08-16 16:10:36,171 DEBUG [org.jboss.remoting.ConnectionNotifier] org.jboss.remoting.ConnectionNotifier@d77a85 notified ConnectionManager[a16b7c] of connection lost to: 3m3b533o-il79jy-gcxc7el5-1-gcxc7fmx-4

       

      2010-08-16 16:10:41,171 DEBUG [org.jboss.jms.client.remoting.ClientSocketWrapper] ServerSocketWrapper[Socket[addr=/x.x.x.x,port=60490,localport=4457].1cd25f]: os = java.net.SocketOutputStream@37633c

      2010-08-16 16:10:41,171 DEBUG [org.jboss.jms.client.remoting.ClientSocketWrapper] ServerSocketWrapper[Socket[addr=/x.x.x.x,port=60490,localport=4457].1cd25f]: os = java.net.SocketOutputStream@542356

       

      client side:

       

      INFO   | jvm 1    | 2010/08/16 16:10:58 | an error occurred in HandleMessage: org.jboss.jms.exception.MessagingTransactionRolledBackException: Failed to invoke

      INFO   | jvm 1    | 2010/08/16 16:10:58 | org.jboss.jms.exception.MessagingTransactionRolledBackException: Failed to invoke

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.tx.ResourceManager.commitLocal(ResourceManager.java:225)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.container.SessionAspect.handleCommit(SessionAspect.java:582)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect26.invoke(SessionAspect26.java)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.ClientSessionDelegate$commit_8461082169793485964.invokeNext(ClientSessionDelegate$commit_8461082169793485964.java)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.ClientSessionDelegate$commit_8461082169793485964.invokeNext(ClientSessionDelegate$commit_8461082169793485964.java)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.ClientSessionDelegate.commit(ClientSessionDelegate.java)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.JBossSession.commit(JBossSession.java:164)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at com.jni.WorkerJni.handleMessage(WorkerJni.java:224)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at com.jni.WorkerJni.main(WorkerJni.java:164)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at java.lang.reflect.Method.invoke(Method.java:597)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at java.lang.Thread.run(Thread.java:619)

      INFO   | jvm 1    | 2010/08/16 16:10:58 | Caused by: org.jboss.jms.exception.MessagingJMSException: Failed to invoke

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:271)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:205)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:160)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.ClientConnectionDelegate.org$jboss$jms$client$delegate$ClientConnectionDelegate$sendTransaction$aop(ClientConnectionDelegate.java:225)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:92)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.ClientConnectionDelegate.sendTransaction(ClientConnectionDelegate.java)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.tx.ResourceManager.commitLocal(ResourceManager.java:206)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 ... 16 more

      INFO   | jvm 1    | 2010/08/16 16:10:58 | Caused by: java.lang.IllegalStateException: Cannot find object in dispatcher with id w-ekj7cxcg-1-90c6cxcg-vn8ywe-o335b3m3

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.wireformat.ConnectionSendTransactionRequest.serverInvoke(ConnectionSendTransactionRequest.java:79)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:157)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:862)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:611)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:423)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:176)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:182)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.remoting.Client.invoke(Client.java:1925)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.remoting.Client.invoke(Client.java:786)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.remoting.Client.invoke(Client.java:774)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:189)

      INFO   | jvm 1    | 2010/08/16 16:10:58 |                 ... 27 more

       

      thanks,

      Noa