Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 304D1CF31 for ; Fri, 27 Apr 2012 05:04:41 +0000 (UTC) Received: (qmail 99840 invoked by uid 500); 27 Apr 2012 05:04:40 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 99319 invoked by uid 500); 27 Apr 2012 05:04:36 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 99301 invoked by uid 99); 27 Apr 2012 05:04:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Apr 2012 05:04:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Apr 2012 05:04:34 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C68D5422F27 for ; Fri, 27 Apr 2012 05:04:13 +0000 (UTC) Date: Fri, 27 Apr 2012 05:04:13 +0000 (UTC) From: "Rich Mayfield (JIRA)" To: java-dev@axis.apache.org Message-ID: <719869167.1445.1335503053814.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (AXIS2-5305) java.util.ConcurrentModificationException when starting Axis2 OSGi bundle MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org 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