Cédric Casenove created FELIX-3548:
--------------------------------------
Summary: Concurrent access during startup
Key: FELIX-3548
URL: https://issues.apache.org/jira/browse/FELIX-3548
Project: Felix
Issue Type: Bug
Components: iPOJO
Affects Versions: ipojo-core-1.8.2
Environment: Felix distribution 4.0.2, iPojo 1.8.2, Oracle JVM
1.6.0_29, Windows XP 32
Reporter: Cédric Casenove
We use the configuration admin to create iPojo instances at runtime. During
Felix startup, an error may happen because 2 threads (one from iPOJO Instance
Creator, the other from Configuration Admin) are accessing a list at the same
time:
2012-06-07 05:13:11,490 GMT+0200 DEBUG [Thread-3] (ipojo.?:?): [DEBUG] iPOJO
Instance Creator : Add the factory FailureHandler
2012-06-07 05:13:11,490 GMT+0200 INFO [CM Configuration Updater
(ManagedServiceFactory Update: factoryPid=FailureHandler)] (ipojo.?:?): [INFO]
requires : Instance requires-1 from factory requires created
2012-06-07 05:13:11,505 GMT+0200 INFO [Thread-3] (ipojo.?:?): [INFO] requires
: Instance requires-2 from factory requires created
2012-06-07 05:13:11,505 GMT+0200 INFO [CM Configuration Updater
(ManagedServiceFactory Update: factoryPid=FailureHandler)] (ipojo.?:?): [INFO]
properties : Instance properties-1 from factory properties created
2012-06-07 05:13:11,505 GMT+0200 INFO [CM Configuration Updater
(ManagedServiceFactory Update: factoryPid=FailureHandler)] (ipojo.?:?): [INFO]
provides : Instance provides-2 from factory provides created
2012-06-07 05:13:11,505 GMT+0200 ERROR [Thread-3] (ipojo.?:?): [ERROR]
IPOJO-Extender : An error occurs when analyzing the content or starting the
management of 99
java.lang.ArrayIndexOutOfBoundsException: 10
at java.util.ArrayList.add(ArrayList.java:352)
at
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:302)
at org.apache.felix.ipojo.IPojoFactory.getHandler(IPojoFactory.java:801)
at
org.apache.felix.ipojo.IPojoFactory.computeDescription(IPojoFactory.java:695)
at
org.apache.felix.ipojo.IPojoFactory.computeFactoryState(IPojoFactory.java:731)
at
org.apache.felix.ipojo.ComponentFactory.addedService(ComponentFactory.java:394)
at
org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:725)
at
org.apache.felix.ipojo.util.Tracker$Tracked.trackInitialServices(Tracker.java:610)
at org.apache.felix.ipojo.util.Tracker.open(Tracker.java:210)
at
org.apache.felix.ipojo.ComponentFactory.starting(ComponentFactory.java:246)
at org.apache.felix.ipojo.IPojoFactory.start(IPojoFactory.java:583)
at
org.apache.felix.ipojo.Extender.createAbstractFactory(Extender.java:439)
at org.apache.felix.ipojo.Extender.parse(Extender.java:264)
at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
at java.lang.Thread.run(Thread.java:662)
2012-06-07 05:13:11,505 GMT+0200 ERROR [CM Configuration Updater
(ManagedServiceFactory Update: factoryPid=FailureHandler)] (configadmin.?:?):
[org.apache.felix.ipojo.Factory, org.osgi.service.cm.ManagedServiceFactory,
id=19, bundle=99]: Unexpected problem updating Configuration
PID=FailureHandler.0bb38d10-b99b-4326-ac36-1717c48f38de,
factoryPID=FailureHandler,
bundleLocation=file:D:\distrib\repository\failurehandler-4.0.0-SNAPSHOT.jar
java.lang.ArrayIndexOutOfBoundsException: 10
at java.util.ArrayList.indexOf(ArrayList.java:216)
at java.util.ArrayList.contains(ArrayList.java:199)
at
org.apache.felix.ipojo.IPojoFactory.generateName(IPojoFactory.java:830)
at
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:279)
at org.apache.felix.ipojo.IPojoFactory.getHandler(IPojoFactory.java:801)
at
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:297)
at
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
at org.apache.felix.ipojo.IPojoFactory.updated(IPojoFactory.java:634)
at
org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.run(ConfigurationManager.java:1366)
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:104)
at java.lang.Thread.run(Thread.java:662)
--
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