7 Replies Latest reply on Mar 7, 2009 6:38 PM by Scott Basinger

    Seam Clustering

    Kurt Stam Newbie

      Hi guys,


      I'm trying to get the seam booking example running in clustered mode using seam-2.0.2.SP1 deployed on jboss-4.2.2.GA. I clustered the stateful session baens and the HTTP Session. I'm using a modjk(ajp) apache setup and 2 appserver, and I'm sticky on the JSESSIONID. When logging on I see to which appserver I'm bound, then disable communication to that node in the Balancer Manager, so now I fail over to the other node. However the booking-application redirects me to logon again. What am I forgetting? The nodes sure are talking to each other.


      Do I need to use a Clustered Single Singon Valve for this to work?


      Thx,


      Kurt

        • 1. Re: Seam Clustering
          Kurt Stam Newbie

          It looks like something goes wrong when serializing the session info:


          13:03:00,270 ERROR [JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedClusteredSession[id: cKrhNBCSg5KciOdaAiMQCA**.server2 lastAccessedTime: 1216227772088 version: 6 lastOutdated: 0]
          java.io.NotSerializableException: java.util.RandomAccessSubList
                  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
                  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
                  at org.jboss.seam.jsf.ListDataModel.writeObject(ListDataModel.java:23)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
                  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
                  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
                  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
                  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
                  at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1380)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
                  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
                  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
                  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
                  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
                  at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.java:175)
                  at org.jboss.web.tomcat.service.session.JBossCacheService.externalizeSession(JBossCacheService.java:1027)
                  at org.jboss.web.tomcat.service.session.JBossCacheService.putSession(JBossCacheService.java:316)
                  at org.jboss.web.tomcat.service.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession.java:121)
                  at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1097)
                  at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:652)
                  at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49)
                  at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:98)
                  at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                  at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
                  at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                  at java.lang.Thread.run(Thread.java:595)



          Anyone else seeing this?


          --Kurt

          • 2. Re: Seam Clustering
            Kurt Stam Newbie

            Yeah if you cluster HotelSearchingAction, in it hotels is not serializable, as the List.subList is not serializable.


            hotels = results.subList(0,pageSize);


            --Kurt


            • 3. Re: Seam Clustering
              Florent PICOT Newbie
              Hi,

                      I'm working on a seam application and have to make it clusterizable. I'm trying on the booking example to test cluster but as soon as i add <distributable/> in web.xml and start the "all" server config of jboss I get the following exception when login in seam-booking:


              11:27:18,819 ERROR [JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedClusteredSession[id: EF35E95A911579A882AFC36299C9E19C lastAccessedTime: 1224667638533 version: 19 lastOutdated: 0]
              java.io.NotSerializableException: java.lang.reflect.Method
                      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
                      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
                      at java.util.HashMap.writeObject(HashMap.java:1000)
                      at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:597)
                      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
                      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
                      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
                      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
                      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
                      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
                      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
                      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
                      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
                      at java.util.ArrayList.writeObject(ArrayList.java:570)
                      at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:597)
                      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
                      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
                      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
                      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
                      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
                      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
                      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
                      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
                      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
                      at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1247)
                      at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:597)
                      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
                      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
                      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
                      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
                      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
                      at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.java:175)
                      at org.jboss.web.tomcat.service.session.JBossCacheService.externalizeSession(JBossCacheService.java:1033)
                      at org.jboss.web.tomcat.service.session.JBossCacheService.putSession(JBossCacheService.java:322)
                      at org.jboss.web.tomcat.service.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession.java:123)
                      at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1127)
                      at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:682)
                      at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49)
                      at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:108)
                      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                      at java.lang.Thread.run(Thread.java:619)

              I am running Jboss 4.2.3 GA JDK6 and use seam 2.1.0 CR1.
              Seam-booking works very well (login, search and booking) without the <distributable/>.

              Am I doing something wrong?
              Thank you for help ;)

              Florent
              • 4. Re: Seam Clustering
                Florent PICOT Newbie

                Nobody have an idea where is the problem?


                Please note that I did not change the seam-booking sources to obtain this exception. Just add the distributable in web.xml and lunch jboss with -c all generates this exception.


                Florent

                • 5. Re: Seam Clustering
                  Marius Oancea Novice
                  I have the same problem. I had some classes that were not serializable. After I solved all now I get:
                  15:28:48,800 ERROR [JBossCacheService] externalizeSession(): exception occurred
                  externalizing session SessionBasedClusteredSession[id: y1lJqbTwNi5SAj9FmvZ65g**.
                  node1 lastAccessedTime: 1235741328690 version: 62 lastOutdated: 0]
                  java.io.NotSerializableException: java.lang.reflect.Method
                          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)

                          at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
                          at java.util.HashMap.writeObject(HashMap.java:984)
                          at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                  sorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:585)
                          at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:89
                  0)



                  Any idea?
                  • 6. Re: Seam Clustering
                    Ralph Hodgson Newbie

                    DITTO to the previous posting.


                    Like Marius I sorted all my non-serializable objects, and got the same exception. This is the second post of this nature I have posted to, surely somebody knows how to run a clustered application on JBoss?


                    I am using JBoss 4.2.3 on jdk 1.5.0_16 and my application is built on Seam 2.1.1.GA. I am using Hibernate as my persistence unit.


                    I am happy to reconfigure my application in any way to make this work, if someone can just suggest a way to resolve this issue.


                    • 7. Re: Seam Clustering
                      Scott Basinger Newbie

                      If you're using Seam 2.1.1, POJO based and framework classes, e.g. EntityHome, EntityQuery, check out the issue here: http://www.seamframework.org/Community/DiagnosingSessionSerializationSeam211GA.  If it works for you, please post back so the JIRA will get faster attention.