Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-6501

ConcurrentModificationException during multiple reference field injection

    XMLWordPrintableJSON

Details

    Description

      java.util.ConcurrentModificationException
      at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1211)
      at java.util.TreeMap$ValueIterator.next(TreeMap.java:1256)
      at org.apache.felix.scr.impl.inject.field.FieldHandler.getReplaceCollection(FieldHandler.java:167)
      at org.apache.felix.scr.impl.inject.field.FieldHandler.updateField(FieldHandler.java:241)
      at org.apache.felix.scr.impl.inject.field.FieldHandler.access$400(FieldHandler.java:50)
      at org.apache.felix.scr.impl.inject.field.FieldHandler$Resolved.invoke(FieldHandler.java:431)
      at org.apache.felix.scr.impl.inject.field.FieldHandler$ReferenceMethodImpl.invoke(FieldHandler.java:501)
      at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:2083)
      at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:2058)
      at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:443)
      at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:333)
      at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:301)
      at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1200)
      at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1121)
      at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:928)
      at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:864)
      at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1152)
      at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:114)
      at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
      at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
      at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
      at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4833)
      at org.apache.felix.framework.Felix.registerService(Felix.java:3804)
      at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328)
      at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:302)
      at org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory.registerAsService(BaseThingHandlerFactory.java:293)
      at org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory.registerFirmwareUpdateHandler(BaseThingHandlerFactory.java:284)
      at org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory.registerHandler(BaseThingHandlerFactory.java:151)
      at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.doRegisterHandler(ThingManagerImpl.java:633)
      at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.registerHandler(ThingManagerImpl.java:614)
      at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.registerAndInitializeHandler(ThingManagerImpl.java:1080)
      at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.lambda$registerChildHandlers$1(ThingManagerImpl.java:656)
      at com.qivicon.runtime.executors.impl.ScheduledExecutorServiceImpl$NamedRunnable.run(ScheduledExecutorServiceImpl.java:80)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

      This is found in 2.1.30, however, the bug exists also in 2.2.0-RC1 even though the 'FileHandler' class has been changed. If we trace back the method ('getReplaceCollection(..)') from the stacktrace in both versions, the implementation remained same, hence, prone to 'ConcurrentModificationException'

      Attachments

        Issue Links

          Activity

            People

              tjwatson Tom Watson
              amitmondal Amit Mondal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: