Hello,
I am facing a weird problem. It may even be silly. :P I have tried doing my research but it has been over 3 days and I have not found a solution.
My problem is:
I have a
servlet which is deployed on two separate
Tomcat instances, instance-1 and instance-2. There is a client which creates a connection with instance-1 (instance-2 is not started yet as it is supposed to be the failover for instance-1). Once the client makes a connection with the server, the srver stores some custom information about the connection. The client must not be aware of whether the server is instance-1 or 2. The client also sends a ping to the server after every two minutes. The server responds with an OK in a custom header if and only if it finds the information that it had stored upon client creating the connection. In between two consecutive pings sent by the client, I want to switch from instance-1 to instance-2. I turn off instance-1. and turn on instance-2. The server.xml of both instances are identical. I want them to run on same port. The connections that the client had made with instance-1 must be recreated with instance-2. But the information about it was stored by instance-1, so instance-2 would not have it. Instance-2 must thus respond with a NOT OK in custom header which will tell the client to re-establish connection with instance-2. However, in my case, when I run instance-2, it still finds the connection information and responds with OK. Both tomcat instances are in separate folders in separate drives. I am new to tomcat and dont understand why is it behaving this way. Is the connection information being stored in a location accessible to instance-2? if so, Why?! and HOW!? Please help. I hope my problem is clear from the above explanation. I am new here so please bear with me.