I have 2 tomcat instances (t1, t2) each running in Eclipse (e1, e2).
I kick off tomcat in both. My app loads in both. I am using the JK
redirector from IIS to load balance between the 2 instances. I bring up a
browser and enter my URL (http://localhost/Acuity). I have a breakpoint in
the sessionListener of the app. It breaks there in t1, so I step through. At
the end of stepping through 'sessionCreated(event)', I run, and it
immediately gives me an exception in t2, and breaks in the session listener
breakpoint (same place) I set there

My Questions are:
1)When is sessionCreated called by Tomcat, i.e., exactly when does a session
get created and how?
2)I get an error at the end of t1.sessionCreated after it steps out of the
function. The error occurs somewhere after t1.sessionCreated and before
t2.sessionCreated. I THINK, it is a replication issue based on the exception
(see t2 exception below), however there may be code that is getting called
between exit of t1.sessionCreated and enter of t2.sessionCreated.
3) How do you debug issues like this???

t1 startup:
.
.
.
INFO: Start ClusterSender at cluster Catalina:type=Cluster,host=localhost
with name Catalina:type=ClusterSender,host=localhost
Nov 28, 2005 3:52:03 PM org.apache.catalina.cluster.mcast.McastService start
INFO: Sleeping for 2000 secs to establish cluster membership
Nov 28, 2005 3:52:05 PM org.apache.catalina.cluster.mcast.McastService
registerMBean
INFO: membership mbean registered
(Catalina:type=ClusterMembership,host=localhost)
Nov 28, 2005 3:52:05 PM org.apache.catalina.cluster.deploy.FarmWarDeployer
start
INFO: Cluster FarmWarDeployer started.
Nov 28, 2005 3:52:07 PM org.apache.catalina.cluster.session.DeltaManager
start
INFO: Register manager /Acuity to cluster element Host with name localhost
Nov 28, 2005 3:52:07 PM org.apache.catalina.cluster.session.DeltaManager
start
INFO: Starting clustering manager at /Acuity
Nov 28, 2005 3:52:07 PM org.apache.catalina.cluster.session.DeltaManager
getAllClusterSessions
INFO: Manager [/Acuity]: skipping state transfer. No members active in
cluster group.
====='We are running Acuity in cluster mode. Current cluster Members:
org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.1.235:4001,catal
ina,192.168.1.235,4001, alive=100]
------------------------------------------------------------------
Acuity AppLifecycleListener - context created
=====   'Acuity Web Application Initialized'   =====

t2 startup:
.
.
.
INFO: Start ClusterSender at cluster Catalina:type=Cluster,host=localhost
with name Catalina:type=ClusterSender,host=localhost
Nov 28, 2005 3:53:30 PM org.apache.catalina.cluster.mcast.McastService start
INFO: Sleeping for 2000 secs to establish cluster membership
Nov 28, 2005 3:53:31 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster
memberAdded
INFO: Replication member
added:org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.1.235:4001
,catalina,192.168.1.235,4001, alive=85703]
Nov 28, 2005 3:53:32 PM org.apache.catalina.cluster.mcast.McastService
registerMBean
INFO: membership mbean registered
(Catalina:type=ClusterMembership,host=localhost)
Nov 28, 2005 3:53:32 PM org.apache.catalina.cluster.deploy.FarmWarDeployer
start
INFO: Cluster FarmWarDeployer started.
Nov 28, 2005 3:53:34 PM org.apache.catalina.cluster.session.DeltaManager
start
INFO: Register manager /Acuity to cluster element Host with name localhost
Nov 28, 2005 3:53:34 PM org.apache.catalina.cluster.session.DeltaManager
start
INFO: Starting clustering manager at /Acuity
Nov 28, 2005 3:53:34 PM org.apache.catalina.cluster.session.DeltaManager
getAllClusterSessions
WARNING: Manager [/Acuity], requesting session state from
org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.1.235:4001,catal
ina,192.168.1.235,4001, alive=89265]. This operation will timeout if no
session state has been received within 60 seconds.
Nov 28, 2005 3:53:34 PM org.apache.catalina.cluster.session.DeltaManager
waitForSendAllSessions
INFO: Manager [/Acuity]; session state send at 11/28/05 3:53 PM received in
203 ms.
====='We are running Acuity in cluster mode. Current cluster Members:
org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.1.235:4001,catal
ina,192.168.1.235,4001, alive=90281]
org.apache.catalina.cluster.mcast.McastMember[tcp://192.168.1.235:4002,catal
ina,192.168.1.235,4002, alive=2172]
------------------------------------------------------------------
Acuity AppLifecycleListener - context created
=====   'Acuity Web Application Initialized'   =====

t1/t2 sessionCreated code:
HttpSession session = event.getSession();
    //session.setAttribute("machine", "t1");
    ServletContext context = session.getServletContext();
    Hashtable sessionMap = (Hashtable) context.getAttribute( "SessionMap" );

    if( sessionMap == null )
    {
      sessionMap = new Hashtable();
      context.setAttribute( "SessionMap", sessionMap );
    }

    //sessionMap.put( session, session ); //  Register that this session is
active


t2 exception:
INFO: Server startup in 7953 ms
Nov 28, 2005 3:57:25 PM org.apache.catalina.cluster.tcp.ReplicationValve
invoke
SEVERE: Unable to perform replication request.
java.lang.NullPointerException
        at
java.io.ObjectOutputStream$BlockDataOutputStream.getUTFLength(ObjectOutputSt
ream.java:1935)
        at
java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream
.java:1806)
        at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:805)
        at
org.apache.catalina.cluster.session.DeltaRequest.writeExternal(DeltaRequest.
java:258)
        at
org.apache.catalina.cluster.session.DeltaManager.unloadDeltaRequest(DeltaMan
ager.java:695)
        at
org.apache.catalina.cluster.session.DeltaManager.requestCompleted(DeltaManag
er.java:1249)
        at
org.apache.catalina.cluster.tcp.ReplicationValve.sendSessionReplicationMessa
ge(ReplicationValve.java:328)
        at
org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve.jav
a:271)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:744)
        at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:674)
        at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java
:866)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
        at java.lang.Thread.run(Thread.java:595)





John McClain
Senior Software Engineer
TCS Healthcare
[EMAIL PROTECTED]
(530)886-1700x235
"Skepticism is the first step toward truth"


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to