3 Replies Latest reply on Dec 2, 2004 3:37 PM by dfisher

    Clustered Sessions Problem

    dfisher Newbie

      Hey Sanne et al,

      sorry for not replying sooner, but I'm quite busy in my day job these days. I will have almost a week off starting Feb 17, and I intend to get the XAResource part done, ro at least a large part of it.

      Sanne: your comments are very much appreciated, I will go over all of them and take them into consideration.

      One thing that we are a bit unclear at this time is whether we can really use the locks given to us by the Locking interceptor because we will need to acquire distributed locks. These are handled exclusively by the CacheInterceptor (or whatever we will call them, maybe they will end up in the CMP interceptor). So, when I mcast a PREPARE, this is communication between the CacheInterceptors (horizonal commmunication) rather than vertical, so at that point the incoming mcast will be received directly by the CacheInterceptor, and not even go through the LockingInterceptor.

      This probably deserves some more thought, and I'll definitely go through your comments and suggestions.

      I believe one possible way would be to make Locking a policy: anyone can replace the Locking policy. Maybe the default Locking policy would make use of locks provided by the LockingInterceptor, other may maintain their own locking tables.

      With respect to multiple threads accessing the same EJB: Yes, this is forbidden by the spec. But, then again, does this make sense ? I believe J2EE does *not* mandate caches in the first place, despite the fact that they are very useful building blocks for any distributed application. So the question is whether we should follow the spec here, or not.

      Cheers,
      Bela

        • 1. Re: Clustered Sessions Problem
          Bela Ban Master

          Ben will probably need the stack trace to determine what's causing the NPE.

          Bela

          • 2. Re: Clustered Sessions Problem
            dfisher Newbie

            This one might be more helpful....
            This is what I get when I try to access a servlet which calls request.getSession():

            2004-12-02 11:11:47,217 DEBUG [org.jboss.web.tomcat.tc5.session.ClusteredSession] initAfterLoad(): initialize the transient variables ...
            2004-12-02 11:11:47,218 DEBUG [org.jboss.web.tomcat.tc5.session.SessionIDGenerator] getSessionId called: rbCWDVUCMFbBzPK8eSBQyg**
            2004-12-02 11:11:47,219 DEBUG [org.jboss.web.tomcat.tc5.session.JBossCacheManager] check to see if needs to store and replicate session with id rbCWDVUCMFbBzPK8eSBQyg**
            2004-12-02 11:11:47,236 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[InformationServlet]: Servlet.service() for servlet InformationServlet threw exception
            java.lang.RuntimeException: JBossCacheManager.getNewTransaction(): failed to look up UserTransaction.
            at org.jboss.web.tomcat.tc5.session.JBossCacheManager.getNewTransaction(JBossCacheManager.java:467)
            at org.jboss.web.tomcat.tc5.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:384)
            at org.jboss.web.tomcat.tc5.session.JBossCacheManager.storeSession(JBossCacheManager.java:214)
            at org.jboss.web.tomcat.tc5.session.JBossCacheManager.add(JBossCacheManager.java:246)
            at org.apache.catalina.session.StandardSession.setId(StandardSession.java:354)
            at org.jboss.web.tomcat.tc5.session.JBossCacheManager.createSession(JBossCacheManager.java:172)
            at org.apache.coyote.tomcat5.CoyoteRequest.doGetSession(CoyoteRequest.java:2274)
            at org.apache.coyote.tomcat5.CoyoteRequest.getSession(CoyoteRequest.java:2116)
            at org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:526)
            at org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:531)
            at edu.vt.middleware.myid.InformationServlet.doGet(InformationServlet.java:35)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:158)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:80)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
            at java.lang.Thread.run(Thread.java:534)
            Caused by: javax.naming.CommunicationException [Root exception is java.rmi.MarshalException: error marshalling arguments; nested exception is:
            java.net.SocketException: Broken pipe]
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:649)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at org.jboss.web.tomcat.tc5.session.JBossCacheManager.getNewTransaction(JBossCacheManager.java:458)
            ... 49 more
            Caused by: java.rmi.MarshalException: error marshalling arguments; nested exception is:
            java.net.SocketException: Broken pipe
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
            at org.jboss.ha.framework.server.HARMIServerImpl_Stub.invoke(Unknown Source)
            at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:127)
            at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:196)
            at $Proxy39.lookup(Unknown Source)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)
            ... 52 more
            Caused by: java.net.SocketException: Broken pipe
            at java.net.SocketOutputStream.socketWrite0(Native Method)
            at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
            at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
            at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
            at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)
            at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1639)
            at java.io.ObjectOutputStream$BlockDataOutputStream.writeByte(ObjectOutputStream.java:1677)
            at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1354)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:281)
            at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:265)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:124)
            ... 57 more

            • 3. Re: Clustered Sessions Problem
              dfisher Newbie

              Here is the exception from the session replication:

              java.lang.RuntimeException: JBossCacheManager.processSessionRepl(): failed to replicate session.
              at org.jboss.web.tomcat.tc5.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:410)
              at org.jboss.web.tomcat.tc5.session.JBossCacheManager.storeSession(JBossCacheManager.java:214)
              at org.jboss.web.tomcat.tc5.session.JBossCacheManager.add(JBossCacheManager.java:246)
              at org.apache.catalina.session.StandardSession.setId(StandardSession.java:354)
              at org.jboss.web.tomcat.tc5.session.JBossCacheManager.createSession(JBossCacheManager.java:172)
              at org.apache.coyote.tomcat5.CoyoteRequest.doGetSession(CoyoteRequest.java:2274)
              at org.apache.coyote.tomcat5.CoyoteRequest.getSession(CoyoteRequest.java:2116)
              at org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:526)
              at org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:531)
              at edu.vt.middleware.myid.InformationServlet.doGet(InformationServlet.java:35)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
              at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
              at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:158)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:80)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
              at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
              at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
              at java.lang.Thread.run(Thread.java:534)
              Caused by: java.lang.NullPointerException
              at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:126)
              at org.jboss.web.tomcat.tc5.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:406)
              ... 48 more