apache-tomcat loses context
i have a client - "two" server project (say two contexts), currently deployed on two different servers (e.g. 192.168.1.101 and 192.168.1.102)
day to day deployment is being done on these two servers,
the configuration is like any external hit came on DNS the load balancer will move the request to any of the server
as per the traffic load.
now the problem is any random time project 1 is not responding to the request,
although i am checking the context is started or not on server by hitting the context directly using the server's ip. that is 192.168.1.101 (and finds it is not responding)
as soon as i restart the apache-tomcat server everything works normally, hows that possible?
please give some suggestions / solutions.
Perhaps if you write a context listener for both your applications, you might be able to determine exactly when the 'contexts are lost'.
Have you tried to see whether the Tomcat deployed on the non-responding machine is up and running? If even the Tomcat is unresponsive, perhaps you should take a look at the server logs.
Have you tried pinging the unresponsive machine? Is it even available on the network when you detect that a particular application isn't responding.
What kind of load balancing implementation are you using?
Joined: Sep 02, 2007
Thanks for the reply,
i will clarify more on this, that among two contexts one is running absolutely fine on both of the servers, when the particular context is down.
# Have you tried to see whether the Tomcat deployed on the non-responding machine is up and running? If even the Tomcat is unresponsive, perhaps you should take a look at the server logs.
-----on Non-responding machine other application or contexts are running perfectly. Tomcat is responsive
# Have you tried pinging the unresponsive machine? Is it even available on the network when you detect that a particular application isn't responding.
-----yes always getting response when pinging the server on which the context is not responsive.
# What kind of load balancing implementation are you using?
----i only know about the load balancer is that it is CISCO product, and the logic which is implemented is
if a user has hit the application and visited the application and even after logging out of the application (context) the balancer will keep that particular ip in session for next half an hour.
after that it will redirect any of the servers.
Joined: Feb 22, 2005
Well that just leaves us with figuring out when/why and whether the application deployed on a particular Tomcat stops responding. I'm assuming that you tried to directly access the application on the particular machine using the 8080 port [or whatever port's configured for Tomcat], and the application wasn't responding even then.
Try another thing - open the Tomcat's admin portal and verify whether the application is still in deployed state. It will be extremely unusual for the application to be undeployed for no particular reason.
Lastly, write Context Listeners to log events before a particular application gets undeployed/stops responding. That might give you a important clue.