axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rich Mayfield (JIRA)" <j...@apache.org>
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
                 URL: https://issues.apache.org/jira/browse/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
org.apache.axis2.osgi-1.6.2
            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
org.apache.axis2.osgi.internal.Activator#start()).

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()
simultaneously.

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(AbstractList.java:372)
	at java.util.AbstractList$Itr.next(AbstractList.java:343)
	at org.apache.axis2.osgi.deployment.tracker.BundleTracker.open(BundleTracker.java:121)
	at org.apache.axis2.osgi.deployment.OSGiConfigurationContextFactory.updated(OSGiConfigurationContextFactory.java:113)
	at org.apache.axis2.osgi.internal.Activator.start(Activator.java:48)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
	... 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message