jboss-4.2.3.GA throws java.util.ConcurrentModificationException when trying to deploy services
gliu007 Sep 24, 2013 2:07 AMOur product are running on jboss 4.2.3, sometimes ConcurrentModificationException is thrown when Jboss are trying to start an instance.
2013-09-14 22:52:30,291 ERROR [STDERR] Failed to boot JBoss:
2013-09-14 22:52:30,292 ERROR [STDERR] java.util.ConcurrentModificationException
2013-09-14 22:52:30,293 ERROR [STDERR] at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
2013-09-14 22:52:30,293 ERROR [STDERR] at java.util.LinkedList$ListItr.next(LinkedList.java:696)
2013-09-14 22:52:30,293 ERROR [STDERR] at org.jboss.system.ServiceController.listIncompletelyDeployed(Unknown Source)
2013-09-14 22:52:30,293 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-09-14 22:52:30,293 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2013-09-14 22:52:30,293 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2013-09-14 22:52:30,293 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
2013-09-14 22:52:30,293 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Unknown Source)
2013-09-14 22:52:30,293 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Unknown Source)
2013-09-14 22:52:30,293 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Unknown Source)
2013-09-14 22:52:30,293 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Unknown Source)
2013-09-14 22:52:30,293 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(Unknown Source)
2013-09-14 22:52:30,293 ERROR [STDERR] at org.jboss.deployment.MainDeployer.checkIncompleteDeployments(Unknown Source)
2013-09-14 22:52:30,293 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-09-14 22:52:30,294 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2013-09-14 22:52:30,294 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2013-09-14 22:52:30,294 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at com.sun.proxy.$Proxy5.deploy(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.system.server.ServerImpl.doStart(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.system.server.ServerImpl.start(Unknown Source)
2013-09-14 22:52:30,294 ERROR [STDERR] at org.jboss.Main.boot(Unknown Source)
2013-09-14 22:52:30,295 ERROR [STDERR] at org.jboss.Main$1.run(Unknown Source)
after doing some tracking down, the issue occurred in org.jboss.system.ServiceController.listIncompletelyDeployed.java it seems installedServices didn't synchronized or just copy another one for modification, this issue is pretty similar with the one reported in http://marc.info/?l=jboss-cvs-commits&m=109699221505347,which has been already fix in Jboss 3.2, but why not fix this one? I've googled a lot using the keyword "ConcurrentModificationException listIncompletelyDeployed" but all results are talking about how to fix the issue in that link.
Didn't anyone encounter such kind of issue?
* for the mbeans whose status is not CREATED, RUNNING, STOPPED or DESTROYED.
*
* An MBean that has reached one of the above states has its dependencies resolved.
*
* @return a List<ServiceContext>
* @jmx:managed-operation
*/
public List listIncompletelyDeployed()
{
List id = new ArrayList();
for (Iterator i = installedServices.iterator(); i.hasNext();)
{
ServiceContext sc = (ServiceContext) i.next();
if ( sc.state != ServiceContext.CREATED &&
sc.state != ServiceContext.RUNNING &&
sc.state != ServiceContext.STOPPED &&
sc.state != ServiceContext.DESTROYED )
{
id.add(sc);
}
}
return id;
}