1 Reply Latest reply on Jul 4, 2012 2:07 AM by Jean-Frederic Clere

    Tomcat 7 and jvmRoute

    Stefano Nichele Newbie

      Hi All,

      i have found an expected behaviour not strictly related to mod-cluster (it seems more a tomcat issue) but i think it could be useful to point it out also here.


      I'm using tomcat 7.0.27 and mod_cluster 1.1.3 and i would like (i did it without issue using tomcat 6.0.13) to have mod_cluster setting the jvmRoute (indeed i'm setting it using the system property jboss.mod_cluster.jvmRoute) to the value i want.


      Starting tomcat i see in the log:


      Jul 3, 2012 10:32:35 AM org.jboss.modcluster.ModClusterService

      INFO: Engine [Catalina] will use jvmRoute: MYVALUE


      that shows me the value i set so i suppose all is workiing fine.


      Actually tomcat doesn't honor that value and all the sessionids are WITHOUT any jvmRoute. Looking at the code of tomcat 7 i saw they introduced a SessionIdGenerator that basically uses the jvmRoute loaded at the creation time and at the creation time the jvmRoute is not valorized yet. 


      Moreover, via jmx, querying "Catalina:type=Engine:" i saw the jvmRoute is CORRECTLY set to my value. So the engine has the right jvmRoute value, but the class SessionIdGenerator doesn't ask to the engine this value but uses the one find at creation time. So no jvmroute in the sessionid.


      Instead, tomcat 6.0.13 asked to the Engine its jvmRoute value any time a sessionid was generated.


      Does anyone experience this issue ?