HTTP Session Replication JBoss3.0.6 with Tomcat 4.1.18
jlouis Feb 20, 2003 10:46 AMI'm having problems getting HTTP Session Replication to work using JBoss 3.0.6 with Tomcat 4.1.18. We have paid for the full set of documentation and I can't seem to find the answer i'm looking for. Any help would be greatly appreciated.
I did manage to get the session replication working two different ways but because of the way our environment is configured neither way will work. The two ways that I did get it to work are:
1. By using Jetty instead of Tomcat, but I would prefer to use Tomcat.
2. By using Tomcat and making the partition name "DefaultPartition" instead of changing it, but I would prefer to be able to change it.
Here is my cluster-service.xml
******************************
<?xml version="1.0" encoding="UTF-8"?>
<server>
<classpath codebase="lib" archives="jbossha.jar"/>
<!-- Cluster Partition: defines cluster -->
<mbean code="org.jboss.ha.framework.server.ClusterPartition"
name="jboss:service=PRODUCTION_PUBLIC">
<attribute name="PartitionName">PRODUCTION_PUBLIC</attribute>
<attribute name="DeadlockDetection">False</attribute>
<attribute name="PartitionConfig">
<Config>
<UDP mcast_addr="228.1.2.3" mcast_port="45566"
ip_ttl="64" ip_mcast="true"
mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
loopback="false" />
<PING timeout="2000" num_initial_members="3"
up_thread="true" down_thread="true" />
<MERGE2 min_interval="5000" max_interval="10000" />
<FD up_thread="true" down_thread="true" />
<VERIFY_SUSPECT timeout="1500"
up_thread="true" down_thread="true" />
<pbcast.STABLE desired_avg_gossip="20000"
up_thread="true" down_thread="true" />
<pbcast.NAKACK gc_lag="50" retransmit_timeout="300,600,1200,2400,4800"
up_thread="true" down_thread="true" />
<UNICAST timeout="5000" window_size="100" min_threshold="10"
down_thread="true" />
<FRAG frag_size="8192"
down_thread="true" up_thread="true" />
<pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
shun="false" print_local_addr="true" />
<pbcast.STATE_TRANSFER up_thread="true" down_thread="true" />
</Config>
</attribute>
</mbean>
<!-- HA Session State Service for SFSB -->
<mbean code="org.jboss.ha.hasessionstate.server.HASessionStateService"
name="jboss:service=HASessionState">
<depends>jboss:service=PRODUCTION_PUBLIC</depends>
<attribute name="PartitionName">PRODUCTION_PUBLIC</attribute>
<attribute name="JndiName">PRODUCTION_PUBLIC</attribute>
<attribute name="BeanCleaningDelay">0</attribute>
</mbean>
<!-- HA JNDI -->
<mbean code="org.jboss.ha.jndi.HANamingService"
name="jboss:service=HAJNDI">
<depends>jboss:service=PRODUCTION_PUBLIC</depends>
<attribute name="PartitionName">PRODUCTION_PUBLIC</attribute>
<attribute name="RmiPort">0</attribute>
<attribute name="Port">1100</attribute>
<attribute name="Backlog">50</attribute>
</mbean>
<mbean code="org.jboss.invocation.jrmp.server.JRMPInvokerHA"
name="jboss:service=invoker,type=jrmpha">
</mbean>
</server>
******************************
The message I get when I start up JBoss indicates to me that HttpSession is dependent on DefaultPartition instead of the name the I changed the partition to. Here's the message:
******************************
ObjectName: jboss:service=ClusteredHttpSession
state: CONFIGURED
I Depend On: jboss.j2ee:service=EJB,jndiName=clustering/HTTPSession
Depends On Me:
ObjectName: jboss.j2ee:service=EJB,jndiName=clustering/HTTPSession
state: NOTYETINSTALLED
I Depend On: jboss:service=DefaultPartition jboss:service=invoker,type=jrmp
Depends On Me: jboss:service=ClusteredHttpSession
******************************
This is the error I get when I try and put something on the session:
******************************
# 10:50:22,902 WARN [InstantSnapshotManager] Failed to replicate sessionID:E2ubwuxdNazvUJqy7ECp6g**
javax.ejb.EJBException: Exception in setHttpSession: java.lang.NullPointerException
at org.jboss.ha.httpsession.server.ClusteredHTTPSessionService.setHttpSession(ClusteredHTTPSessionService.java:103)
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy24.setHttpSession(Unknown Source)
at org.jboss.web.catalina.session.ClusterManager.storeSession(ClusterManager.java:499)
at org.jboss.web.catalina.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:38)
at org.jboss.web.catalina.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:88)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
at java.lang.Thread.run(Thread.java:536)
******************************