axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rich Mayfield (JIRA)" <>
Subject [jira] [Created] (AXIS2-5305) java.util.ConcurrentModificationException when starting Axis2 OSGi bundle
Date Fri, 27 Apr 2012 05:04:13 GMT
Rich Mayfield created AXIS2-5305:

             Summary: java.util.ConcurrentModificationException when starting Axis2 OSGi bundle
                 Key: AXIS2-5305
             Project: Axis2
          Issue Type: Bug
          Components: modules
    Affects Versions: 1.6.2
         Environment: Mac OS X 10.7.3
Java 1.6.0_31
Equinox 3.7.2
Felix Configuration Admin Service 1.2.8
            Reporter: Rich Mayfield

There is a race condition during the Axis2 bundle's startup.

1) The Axis2 bundle Activator creates and starts OSGiConfigurationContextFactory, which in
turn registers a ManagedService.
2) After creating and starting the managed service it invokes updated() on that service (see

Problem is, if the configuration admin service is running it will listen for ManagedService
registrations like the one in 1) above and it will spin up a thread that will also call the
ManagedService updated() method. This means that two threads are calling into OSGiConfigurationContextFactory#updated()

This in turn means that while one thread is calling open() on the BundleTracker another thread
is calling addRegistry(). In BundleTracker#open() the code spins through the list of registries
and this is where the exception happens.

Caused by: java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(
	at java.util.AbstractList$
	at org.apache.axis2.osgi.deployment.OSGiConfigurationContextFactory.updated(
	at org.apache.axis2.osgi.internal.Activator.start(
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$
	at Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(
	... 33 more

If I stop the configuration admin service and start the Axis2 bundle it works. This is because
the 2nd thread is not calling into the ManagedService's updated() method. This (shutting down
the config admin service to start another bundle), however, is not a viable workaround as
it is totally unreasonable to require this.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message