-
1. Re: Clustering of the Seam-booking example
steppi Jun 18, 2009 7:14 AM (in response to steppi)So I got something new.
I read in the seam-clustering tutorial about changing the code of the example a little bit.
Everythink works perfect up to the point I log into the application. Following Error occur:
11:43:37,804 WARN [/seam-booking] Failed to replicate session 0pskpPW-ReEg3gLA7JF6PA__
org.jboss.seam.security.NotLoggedInException
at org.jboss.seam.security.Identity.checkRestriction(Identity.java:217)
at org.jboss.seam.security.SecurityInterceptor$Restriction.check(SecurityInterceptor.java:113)
at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:159)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:118)
at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
at org.javassist.tmp.java.lang.Object_$$_javassist_4.hashCode(Object_$$_javassist_4.java)
at java.util.HashMap$Entry.hashCode(HashMap.java:737)
at java.util.AbstractMap.hashCode(AbstractMap.java:494)
at org.jboss.ha.framework.server.SimpleCachableMarshalledValue.(SimpleCachableMarshalledValue.java:74)
at org.jboss.ha.framework.server.SimpleCachableMarshalledValue.(SimpleCachableMarshalledValue.java:80)
at org.jboss.web.tomcat.service.session.distributedcache.spi.SessionSerializationFactory.createMarshalledValue(SessionSerializationFactory.java:74)
at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AbstractJBossCacheService.getMarshalledValue(AbstractJBossCacheService.java:635)
at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.SessionBasedJBossCacheService.storeSessionAttributes(SessionBasedJBossCacheService.java:124)
at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.SessionBasedJBossCacheService.storeSessionAttributes(SessionBasedJBossCacheService.java:37)
at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AbstractJBossCacheService.storeSessionData(AbstractJBossCacheService.java:403)
at org.jboss.web.tomcat.service.session.ClusteredSession.processSessionReplication(ClusteredSession.java:1166)
at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1937)
at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:309)
at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:51)
at org.jboss.web.tomcat.service.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:147)
at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:94)
at org.jboss.web.tomcat.service.session.LockingValve.invoke(LockingValve.java:62)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
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:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:636) -
2. Re: Clustering of the Seam-booking example
pferraro Jun 24, 2009 10:11 AM (in response to steppi)I was not able to reproduce this error myself. The session created after login is successfully replicated to the other node. May I ask the full extent of the changes you made to the booking example to enable clustering?
Regarding accessing both servers via a single IP, you'll need another server to act as a load balancer (e.g. Apache HTTP server w/ mod_proxy+mod_cluster, or mod_proxy+mod_proxy_balancer, or mod_jk). The client will access the IP/port of the load balancer which in turn directs the request to one of the servers. More info here:
http://httpd.apache.org/docs/2.2/
http://www.jboss.org/mod_cluster
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html
http://tomcat.apache.org/connectors-doc/index.html
Regarding creating redundancy if one node fails, this is achieved through proper replication of all of the stateful elements of your application. You've already enabled session replication, by adding to web.xml. You will also want to replicate any stateful session beans, by adding the @Clustered annotation to the bean classes. If any of your entity beans use hibernate's 2nd-level cache, you'll need to configure hibernate to use a distributed 2nd-level cache, as described here:
http://www.jboss.org/community/docs/DOC-13200