We have a winner. Creating a system property at startup and appending it to the session id worked. I was able to run multiple Tomcat instances, both on the same and multiple hosts, with 100% session stickiness. This approach will work perfectly, as we can use the jvmroute parameter as an input argument for the scripts we use to start Tomcat.
Thanks to all who helped to get this working. Karl -----Original Message----- From: Rainer Jung [mailto:rainer.j...@kippdata.de] Sent: Monday, August 15, 2011 4:01 PM To: users@tomcat.apache.org Subject: Re: Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8 On 15.08.2011 21:20, Pid wrote: > On 15/08/2011 19:09, Lataxes, Karl wrote: >> I wrote the code to generate the session id and add it as an HTTP header at >> the recommendation of someone on the users list. The problem now is >> appending the jvmroute to the generated session id in order to get session >> stickiness to work. If there were some way for the servlet to retrieve the >> jvmRoute from server.xml, I could append it to the session id and get it to >> work. I have been looking online for a solution, but have been unable to >> find one. > > Try using JMX. > > Look up the appropriate object (there are clues in the source of the > Manager app) and then retrieve the value of the appropriate attribute. > > I would experiment with setting this value in the servlet.init() method. Or, since you don't really need a jvmRoute but just something to add to the session id which is known by mod_jk, you can set a system property "-DjvmRoute=tomcat7A" etc. Then retrieve the value as a system property and add it to the session id, separated with a dot. Regards, Rainer --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org