Following is the stack trace that we get when we make request for the same page on different environments:
[05-03-2008 11:33:39.483] [4130090] [org.apache.catalina.connector.CoyoteAdapter] [ERROR] [ajp-0.0.0.0-18249-1] An exception or error occurred in the contai
ner during the request processing
java.lang.StringIndexOutOfBoundsException: String index out of range: 54
at java.lang.String.substring(String.java:1765)
at org.jboss.web.tomcat.service.session.JvmRouteValve.handleJvmRoute(JvmRouteValve.java:128)
at org.jboss.web.tomcat.service.session.JvmRouteValve.checkJvmRoute(JvmRouteValve.java:112)
at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:81)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:419)
at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:393)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1513)
at java.lang.Thread.run(Thread.java:595)
After little investigation it looks like in handleJvmRoute method when getting the receivedJvmRoute from the oldsessionId, substring method is using the length from the sessionId rather than the oldsessionId.
We are running with JBoss 4.2.1.