-
Bug
-
Resolution: Done
-
Major
-
jbossws-2.0.1
-
None
-
Medium
When SOAP requests hit JBoss during application deployment they are somewhat queued and get processed just after the application starts. Everything works fine if the are only several requests. If there are more (like 30 or above) before the application starts, HandlerResolverImpl causes ConcurrentModificationException at line 22 (getHandlerChain()).
This exception does not cause the application to stop working, but results in a very strange behaviour, namely: every request goes only through JAXWS Handler twice (on inbound and outbound traffic) but does not hit service implementation (in my case - EJB3 SLSB).
The only clue for me to resolve this problem was to stick to the ConcurrentModificationException and its stacktrace. Going down this path I decided to modify some code in class org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS. I synchronized a block of code responsible for initiating handler chains, so the modified method looks like this:
public boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
{
log.debug("callRequestHandlerChain: " + type);
// Initialize the handler chain
if (isInitialized() == false)
{
synchronized(resolver)
}
HandlerChainExecutor executor = createExecutor(sepMetaData, type);
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
return executor.handleMessage(msgContext);
}
I tried to do synchronized(this) at the beginning but it very quickly resulted in unstable AS behaviour and stopping JVM with a core dump in the end (SIC!).
Since we are talking about serious production deployment in 5 days (servicing ca. 5000 SOAP requests per hour) , I decided to incorporate my fix into the environment, but I am not completely sure wheter my fix imposes any performance pitfalls.
If you find a better idea to solve this problem, please be quick to publish a solution
- is duplicated by
-
JBWS-1859 Concurrency issue in building the request handler chain when more than one handler is specified
- Closed
- is incorporated by
-
JBPAPP-1760 JBossWS - ConcurrentModificationException in initHandlerChain()
- Closed