While I could not reproduce this, and get the same infinite loop behaviour, I can show that it is possible to get at least two threads to acess the getEncInjectionsForClass(Class<?> clazz, boolean isDynamic) method of the same TomcatInjectionContainer object. I did this by enabling development mode, and setting the 'modificationTestInterval' of the JspServlet in deployers/jbossweb.deployer/web.xml
<init-param>
<param-name>development</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>modificationTestInterval</param-name>
<param-value>0</param-value>
</init-param>
I then created a rendezvous with Byteman, and accessed two different jsps, deployed to the same web application. The Byteman script halted by first thread, to the first jsp, at line 443, an access to the hashMap, will the second thread entered the same method, of the same object, and also accessed the hashmap. See my Byteman script, and associated output below:
RULE TomcatInjectionContainer
CLASS org.jboss.web.tomcat.service.TomcatInjectionContainer
METHOD getEncInjectionsForClass(Class, boolean)
AT LINE 443
IF true
DO
traceln("** creating rendezvous for class: " + $1);
createRendezvous("encInjectionsEntry", 2);
traceln("** rendezvous created");
rendezvous("encInjectionsEntry");
traceln("** rendezvous executed: " + $0)
ENDRULE
16:45:46,639 INFO [STDOUT] retransforming org.jboss.web.tomcat.service.TomcatInjectionContainer
16:45:46,646 INFO [STDOUT] org.jboss.byteman.agent.Transformer : possible trigger for rule TomcatInjectionContainer in class org.jboss.web.tomcat.service.TomcatInjectionContainer
16:45:46,661 INFO [STDOUT] RuleTriggerMethodAdapter.injectTriggerPoint : inserting trigger into org.jboss.web.tomcat.service.TomcatInjectionContainer.getEncInjectionsForClass(java.lang.Class,boolean) java.util.Map for rule TomcatInjectionContainer
16:45:46,669 INFO [STDOUT] org.jboss.byteman.agent.Transformer : inserted trigger for TomcatInjectionContainer in class org.jboss.web.tomcat.service.TomcatInjectionContainer
16:45:49,257 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:49,268 INFO [STDOUT] HelperManager.install for helper classorg.jboss.byteman.rule.helper.Helper
16:45:49,269 INFO [STDOUT] calling activated() for helper classorg.jboss.byteman.rule.helper.Helper
16:45:49,269 INFO [STDOUT] Default helper activated
16:45:49,269 INFO [STDOUT] calling installed(TomcatInjectionContainer) for helper classorg.jboss.byteman.rule.helper.Helper
16:45:49,269 INFO [STDOUT] Installed rule using default helper : TomcatInjectionContainer
16:45:49,269 INFO [STDOUT] TomcatInjectionContainer execute
16:45:49,270 INFO [STDOUT] ** creating rendezvous for class: class org.apache.jsp.encInjections_jsp
16:45:49,270 INFO [STDOUT] ** rendezvous created
16:45:52,236 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,237 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,237 INFO [STDOUT] ** creating rendezvous for class: class org.apache.jsp.otherEncInjections_jsp
16:45:52,238 INFO [STDOUT] ** rendezvous created
16:45:52,238 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,238 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,238 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,238 INFO [STDOUT] ** creating rendezvous for class: class org.apache.jsp.encInjections_jsp
16:45:52,239 INFO [STDOUT] ** rendezvous created
16:45:52,239 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,239 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,239 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,239 INFO [STDOUT] ** creating rendezvous for class: class org.apache.jsp.otherEncInjections_jsp
16:45:52,239 INFO [STDOUT] ** rendezvous created
16:45:52,239 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,241 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,241 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,241 INFO [STDOUT] ** creating rendezvous for class: class org.apache.jsp.encInjections_jsp
16:45:52,241 INFO [STDOUT] ** rendezvous created
16:45:52,242 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,243 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,243 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,243 INFO [STDOUT] ** creating rendezvous for class: class org.apache.jsp.otherEncInjections_jsp
16:45:52,244 INFO [STDOUT] ** rendezvous created
16:45:52,244 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,245 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,245 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,245 INFO [STDOUT] ** creating rendezvous for class: class org.apache.taglibs.standard.tag.rt.core.IfTag
16:45:52,245 INFO [STDOUT] ** rendezvous created
16:45:52,246 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,247 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,247 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,247 INFO [STDOUT] ** creating rendezvous for class: class org.apache.taglibs.standard.tag.rt.core.IfTag
16:45:52,247 INFO [STDOUT] ** rendezvous created
16:45:52,247 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,247 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,247 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,247 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,247 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,247 INFO [STDOUT] ** creating rendezvous for class: class javax.servlet.jsp.jstl.core.ConditionalTagSupport
16:45:52,247 INFO [STDOUT] ** rendezvous created
16:45:52,247 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,247 INFO [STDOUT] ** creating rendezvous for class: class javax.servlet.jsp.jstl.core.ConditionalTagSupport
16:45:52,247 INFO [STDOUT] ** rendezvous created
16:45:52,248 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,248 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,248 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,248 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,248 INFO [STDOUT] Rule.execute called for TomcatInjectionContainer_1
16:45:52,248 INFO [STDOUT] ** creating rendezvous for class: class javax.servlet.jsp.tagext.TagSupport
16:45:52,248 INFO [STDOUT] TomcatInjectionContainer execute
16:45:52,248 INFO [STDOUT] ** rendezvous created
16:45:52,248 INFO [STDOUT] ** creating rendezvous for class: class javax.servlet.jsp.tagext.TagSupport
16:45:52,248 INFO [STDOUT] ** rendezvous created
16:45:52,248 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86
16:45:52,248 INFO [STDOUT] ** rendezvous executed: org.jboss.web.tomcat.service.TomcatInjectionContainer@21cb0e86