Felix
  1. Felix
  2. FELIX-3242

Concurrent modification problem in StatefulResolver$ResolverStateImpl.getCandidates

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: framework-4.0.1
    • Fix Version/s: framework-4.2.0
    • Component/s: Framework
    • Labels:
      None

      Description

      I occasionally see this stack trace (2 examples) starting stuff in karaf running on felix 4.0.1 Unfortunately it happens rarely and with no pattern I can discern.

      [Blueprint Extender: 3] ERROR org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener - Error calling listener method public synchronized void org.apache.karaf.shell.console.jline.ConsoleFactory.registerCommandProcessor(org.apache.felix.service.command.CommandProcessor) throws java.lang.Exception
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:238)
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.invokeMethods(AbstractServiceReferenceRecipe.java:460)
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.bind(AbstractServiceReferenceRecipe.java:442)
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.bind(AbstractServiceReferenceRecipe.java:339)
      at org.apache.aries.blueprint.container.ReferenceRecipe.bind(ReferenceRecipe.java:149)
      at org.apache.aries.blueprint.container.ReferenceRecipe.retrack(ReferenceRecipe.java:114)
      at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.updateListeners(AbstractServiceReferenceRecipe.java:331)
      at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:93)
      at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:71)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:79)
      at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:220)
      at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:154)
      at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:630)
      at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:326)
      at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:228)
      at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)
      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.felix.framework.StatefulResolver$ResolverStateImpl.getCandidates(StatefulResolver.java:1333)
      at org.apache.felix.framework.StatefulResolver.isAllowedDynamicImport(StatefulResolver.java:521)
      at org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:216)
      at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1539)
      at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)
      at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
      at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2128)
      at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)
      at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
      at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1317)
      at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1481)
      at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1427)
      at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
      at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at org.apache.karaf.shell.console.jline.ConsoleFactory.start(ConsoleFactory.java:71)
      at org.apache.karaf.shell.console.jline.ConsoleFactory.registerCommandProcessor(ConsoleFactory.java:51)
      ... 30 more

      ----------------------------------------------------
      [Thread-8] ERROR org.apache.karaf.features.internal.FeaturesServiceImpl - Error installing boot feature management
      java.io.IOException: javax.xml.bind.JAXBException: Unable to create context

      • with linked exception:
        [java.lang.reflect.InvocationTargetException] : mvn:org.apache.karaf.features/enterprise/3.0.0-SNAPSHOT/xml/features
        at org.apache.karaf.features.internal.RepositoryImpl.load(RepositoryImpl.java:96)
        at org.apache.karaf.features.internal.RepositoryImpl.getRepositories(RepositoryImpl.java:69)
        at org.apache.karaf.features.internal.FeaturesServiceImpl.getFeatures(FeaturesServiceImpl.java:910)
        at org.apache.karaf.features.internal.FeaturesServiceImpl.getFeature(FeaturesServiceImpl.java:870)
        at org.apache.karaf.features.internal.FeaturesServiceImpl$1.run(FeaturesServiceImpl.java:994)
        Caused by: java.lang.RuntimeException: javax.xml.bind.JAXBException: Unable to create context
      • with linked exception:
        [java.lang.reflect.InvocationTargetException]
        at org.apache.karaf.features.internal.model.JaxbUtil.unmarshal(JaxbUtil.java:126)
        at org.apache.karaf.features.internal.RepositoryImpl.load(RepositoryImpl.java:88)
        ... 4 more
        Caused by: javax.xml.bind.JAXBException: Unable to create context
      • with linked exception:
        [java.lang.reflect.InvocationTargetException]
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:116)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:65)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:56)
        at org.apache.karaf.features.internal.model.JaxbUtil.unmarshal(JaxbUtil.java:107)
        ... 5 more
        Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:114)
        ... 8 more
        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.felix.framework.StatefulResolver$ResolverStateImpl.getCandidates(StatefulResolver.java:1333)
        at org.apache.felix.framework.StatefulResolver.isAllowedDynamicImport(StatefulResolver.java:521)
        at org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:216)
        at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1539)
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
        at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
        at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:181)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
        at java.lang.reflect.Method.declaredAnnotations(Method.java:693)
        at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:686)
        at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:175)
        at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllMethodAnnotations(RuntimeInlineAnnotationReader.java:89)
        at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllMethodAnnotations(RuntimeInlineAnnotationReader.java:57)
        at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.ensureNoAnnotation(ClassInfoImpl.java:1130)
        at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.collectGetterSetters(ClassInfoImpl.java:1069)
        at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.findGetterSetterProperties(ClassInfoImpl.java:943)
        at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:314)
        at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:186)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:247)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:104)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:85)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:213)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:99)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:85)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:319)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:334)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:483)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:319)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1170)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
        ... 13 more

        Issue Links

          Activity

          Hide
          Hendy Irawan added a comment -

          Spoke too soon. Now I'm not sure if felix 4.1.0-20130205.222907-15 made an effect. Error after restart/refresh bundle:

          {
            "level" : "ERROR",
            "message" : {
              "messagePattern" : "Unable to start blueprint container for bundle berbatik_dev_commerce_model"
            },
            "logger" : "org.apache.aries.blueprint.container.BlueprintContainerImpl",
            "throwable" : {
              "cause" : {
                "name" : "java.lang.NullPointerException",
                "omittedElements" : 0
              },
              "message" : "java.lang.NullPointerException",
              "name" : "org.osgi.service.blueprint.container.ComponentDefinitionException",
              "omittedElements" : 0,
              "stackTrace" : [ {
                "className" : "org.apache.aries.blueprint.container.ReferenceRecipe",
                "exact" : false,
                "fileName" : "ReferenceRecipe.java",
                "lineNumber" : 116,
                "methodName" : "internalCreate"
              }, {
                "className" : "org.apache.aries.blueprint.di.AbstractRecipe$1",
                "exact" : false,
                "fileName" : "AbstractRecipe.java",
                "lineNumber" : 79,
                "methodName" : "call"
              }, {
                "className" : "java.util.concurrent.FutureTask$Sync",
                "exact" : false,
                "fileName" : "FutureTask.java",
                "lineNumber" : 334,
                "methodName" : "innerRun"
              }, {
                "className" : "java.util.concurrent.FutureTask",
                "exact" : false,
                "fileName" : "FutureTask.java",
                "lineNumber" : 166,
                "methodName" : "run"
              }, {
                "className" : "org.apache.aries.blueprint.di.AbstractRecipe",
                "exact" : false,
                "fileName" : "AbstractRecipe.java",
                "lineNumber" : 88,
                "methodName" : "create"
              }, {
                "className" : "org.apache.aries.blueprint.container.BeanRecipe",
                "exact" : false,
                "fileName" : "BeanRecipe.java",
                "lineNumber" : 933,
                "methodName" : "setProperty"
              }, {
                "className" : "org.apache.aries.blueprint.container.BeanRecipe",
                "exact" : false,
                "fileName" : "BeanRecipe.java",
                "lineNumber" : 907,
                "methodName" : "setProperties"
              }, {
                "className" : "org.apache.aries.blueprint.container.BeanRecipe",
                "exact" : false,
                "fileName" : "BeanRecipe.java",
                "lineNumber" : 888,
                "methodName" : "setProperties"
              }, {
                "className" : "org.apache.aries.blueprint.container.BeanRecipe",
                "exact" : false,
                "fileName" : "BeanRecipe.java",
                "lineNumber" : 820,
                "methodName" : "internalCreate2"
              }, {
                "className" : "org.apache.aries.blueprint.container.BeanRecipe",
                "exact" : false,
                "fileName" : "BeanRecipe.java",
                "lineNumber" : 787,
                "methodName" : "internalCreate"
              }, {
                "className" : "org.apache.aries.blueprint.di.AbstractRecipe$1",
                "exact" : false,
                "fileName" : "AbstractRecipe.java",
                "lineNumber" : 79,
                "methodName" : "call"
              }, {
                "className" : "java.util.concurrent.FutureTask$Sync",
                "exact" : false,
                "fileName" : "FutureTask.java",
                "lineNumber" : 334,
                "methodName" : "innerRun"
              }, {
                "className" : "java.util.concurrent.FutureTask",
                "exact" : false,
                "fileName" : "FutureTask.java",
                "lineNumber" : 166,
                "methodName" : "run"
              }, {
                "className" : "org.apache.aries.blueprint.di.AbstractRecipe",
                "exact" : false,
                "fileName" : "AbstractRecipe.java",
                "lineNumber" : 88,
                "methodName" : "create"
              }, {
                "className" : "org.apache.aries.blueprint.container.BlueprintRepository",
                "exact" : false,
                "fileName" : "BlueprintRepository.java",
                "lineNumber" : 247,
                "methodName" : "createInstances"
              }, {
                "className" : "org.apache.aries.blueprint.container.BlueprintRepository",
                "exact" : false,
                "fileName" : "BlueprintRepository.java",
                "lineNumber" : 230,
                "methodName" : "createInstance"
              }, {
                "className" : "org.apache.aries.blueprint.container.BlueprintRepository",
                "exact" : false,
                "fileName" : "BlueprintRepository.java",
                "lineNumber" : 155,
                "methodName" : "create"
              }, {
                "className" : "org.apache.aries.blueprint.container.BlueprintContainerImpl",
                "exact" : false,
                "fileName" : "BlueprintContainerImpl.java",
                "lineNumber" : 534,
                "methodName" : "processProcessors"
              }, {
                "className" : "org.apache.aries.blueprint.container.BlueprintContainerImpl",
                "exact" : false,
                "fileName" : "BlueprintContainerImpl.java",
                "lineNumber" : 367,
                "methodName" : "doRun"
              }, {
                "className" : "org.apache.aries.blueprint.container.BlueprintContainerImpl",
                "exact" : false,
                "fileName" : "BlueprintContainerImpl.java",
                "lineNumber" : 272,
                "methodName" : "run"
              }, {
                "className" : "org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable",
                "exact" : false,
                "fileName" : "DiscardableRunnable.java",
                "lineNumber" : 48,
                "methodName" : "run"
              }, {
                "className" : "java.util.concurrent.Executors$RunnableAdapter",
                "exact" : false,
                "fileName" : "Executors.java",
                "lineNumber" : 471,
                "methodName" : "call"
              }, {
                "className" : "java.util.concurrent.FutureTask$Sync",
                "exact" : false,
                "fileName" : "FutureTask.java",
                "lineNumber" : 334,
                "methodName" : "innerRun"
              }, {
                "className" : "java.util.concurrent.FutureTask",
                "exact" : false,
                "fileName" : "FutureTask.java",
                "lineNumber" : 166,
                "methodName" : "run"
              }, {
                "className" : "java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask",
                "exact" : false,
                "fileName" : "ScheduledThreadPoolExecutor.java",
                "lineNumber" : 178,
                "methodName" : "access$201"
              }, {
                "className" : "java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask",
                "exact" : false,
                "fileName" : "ScheduledThreadPoolExecutor.java",
                "lineNumber" : 292,
                "methodName" : "run"
              }, {
                "className" : "java.util.concurrent.ThreadPoolExecutor",
                "exact" : false,
                "fileName" : "ThreadPoolExecutor.java",
                "lineNumber" : 1110,
                "methodName" : "runWorker"
              }, {
                "className" : "java.util.concurrent.ThreadPoolExecutor$Worker",
                "exact" : false,
                "fileName" : "ThreadPoolExecutor.java",
                "lineNumber" : 603,
                "methodName" : "run"
              }, {
                "className" : "java.lang.Thread",
                "exact" : false,
                "fileName" : "Thread.java",
                "lineNumber" : 722,
                "methodName" : "run"
              } ]
            },
            "callStack" : [ {
              "className" : "org.apache.aries.blueprint.container.BlueprintContainerImpl",
              "exact" : false,
              "fileName" : "BlueprintContainerImpl.java",
              "lineNumber" : 409,
              "methodName" : "doRun"
            } ],
            "mdc" : {
              "bundle.id" : "7",
              "bundle.version" : "1.0.1",
              "application" : "berbatik_dev",
              "bundle.name" : "org.apache.aries.blueprint.core"
            },
            "threadInfo" : {
              "name" : "Blueprint Extender: 3"
            },
            "loggerContext" : {
              "name" : "berbatik_dev"
            },
            "timeStamp" : 1360493985973
          }
          

          But I guess it's on Aries's side.

          Show
          Hendy Irawan added a comment - Spoke too soon. Now I'm not sure if felix 4.1.0-20130205.222907-15 made an effect. Error after restart/refresh bundle: { "level" : "ERROR" , "message" : { "messagePattern" : "Unable to start blueprint container for bundle berbatik_dev_commerce_model" }, "logger" : "org.apache.aries.blueprint.container.BlueprintContainerImpl" , "throwable" : { "cause" : { "name" : "java.lang.NullPointerException" , "omittedElements" : 0 }, "message" : "java.lang.NullPointerException" , "name" : "org.osgi.service.blueprint.container.ComponentDefinitionException" , "omittedElements" : 0, "stackTrace" : [ { "className" : "org.apache.aries.blueprint.container.ReferenceRecipe" , "exact" : false , "fileName" : "ReferenceRecipe.java" , "lineNumber" : 116, "methodName" : "internalCreate" }, { "className" : "org.apache.aries.blueprint.di.AbstractRecipe$1" , "exact" : false , "fileName" : "AbstractRecipe.java" , "lineNumber" : 79, "methodName" : "call" }, { "className" : "java.util.concurrent.FutureTask$Sync" , "exact" : false , "fileName" : "FutureTask.java" , "lineNumber" : 334, "methodName" : "innerRun" }, { "className" : "java.util.concurrent.FutureTask" , "exact" : false , "fileName" : "FutureTask.java" , "lineNumber" : 166, "methodName" : "run" }, { "className" : "org.apache.aries.blueprint.di.AbstractRecipe" , "exact" : false , "fileName" : "AbstractRecipe.java" , "lineNumber" : 88, "methodName" : "create" }, { "className" : "org.apache.aries.blueprint.container.BeanRecipe" , "exact" : false , "fileName" : "BeanRecipe.java" , "lineNumber" : 933, "methodName" : "setProperty" }, { "className" : "org.apache.aries.blueprint.container.BeanRecipe" , "exact" : false , "fileName" : "BeanRecipe.java" , "lineNumber" : 907, "methodName" : "setProperties" }, { "className" : "org.apache.aries.blueprint.container.BeanRecipe" , "exact" : false , "fileName" : "BeanRecipe.java" , "lineNumber" : 888, "methodName" : "setProperties" }, { "className" : "org.apache.aries.blueprint.container.BeanRecipe" , "exact" : false , "fileName" : "BeanRecipe.java" , "lineNumber" : 820, "methodName" : "internalCreate2" }, { "className" : "org.apache.aries.blueprint.container.BeanRecipe" , "exact" : false , "fileName" : "BeanRecipe.java" , "lineNumber" : 787, "methodName" : "internalCreate" }, { "className" : "org.apache.aries.blueprint.di.AbstractRecipe$1" , "exact" : false , "fileName" : "AbstractRecipe.java" , "lineNumber" : 79, "methodName" : "call" }, { "className" : "java.util.concurrent.FutureTask$Sync" , "exact" : false , "fileName" : "FutureTask.java" , "lineNumber" : 334, "methodName" : "innerRun" }, { "className" : "java.util.concurrent.FutureTask" , "exact" : false , "fileName" : "FutureTask.java" , "lineNumber" : 166, "methodName" : "run" }, { "className" : "org.apache.aries.blueprint.di.AbstractRecipe" , "exact" : false , "fileName" : "AbstractRecipe.java" , "lineNumber" : 88, "methodName" : "create" }, { "className" : "org.apache.aries.blueprint.container.BlueprintRepository" , "exact" : false , "fileName" : "BlueprintRepository.java" , "lineNumber" : 247, "methodName" : "createInstances" }, { "className" : "org.apache.aries.blueprint.container.BlueprintRepository" , "exact" : false , "fileName" : "BlueprintRepository.java" , "lineNumber" : 230, "methodName" : "createInstance" }, { "className" : "org.apache.aries.blueprint.container.BlueprintRepository" , "exact" : false , "fileName" : "BlueprintRepository.java" , "lineNumber" : 155, "methodName" : "create" }, { "className" : "org.apache.aries.blueprint.container.BlueprintContainerImpl" , "exact" : false , "fileName" : "BlueprintContainerImpl.java" , "lineNumber" : 534, "methodName" : "processProcessors" }, { "className" : "org.apache.aries.blueprint.container.BlueprintContainerImpl" , "exact" : false , "fileName" : "BlueprintContainerImpl.java" , "lineNumber" : 367, "methodName" : "doRun" }, { "className" : "org.apache.aries.blueprint.container.BlueprintContainerImpl" , "exact" : false , "fileName" : "BlueprintContainerImpl.java" , "lineNumber" : 272, "methodName" : "run" }, { "className" : "org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable" , "exact" : false , "fileName" : "DiscardableRunnable.java" , "lineNumber" : 48, "methodName" : "run" }, { "className" : "java.util.concurrent.Executors$RunnableAdapter" , "exact" : false , "fileName" : "Executors.java" , "lineNumber" : 471, "methodName" : "call" }, { "className" : "java.util.concurrent.FutureTask$Sync" , "exact" : false , "fileName" : "FutureTask.java" , "lineNumber" : 334, "methodName" : "innerRun" }, { "className" : "java.util.concurrent.FutureTask" , "exact" : false , "fileName" : "FutureTask.java" , "lineNumber" : 166, "methodName" : "run" }, { "className" : "java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask" , "exact" : false , "fileName" : "ScheduledThreadPoolExecutor.java" , "lineNumber" : 178, "methodName" : "access$201" }, { "className" : "java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask" , "exact" : false , "fileName" : "ScheduledThreadPoolExecutor.java" , "lineNumber" : 292, "methodName" : "run" }, { "className" : "java.util.concurrent.ThreadPoolExecutor" , "exact" : false , "fileName" : "ThreadPoolExecutor.java" , "lineNumber" : 1110, "methodName" : "runWorker" }, { "className" : "java.util.concurrent.ThreadPoolExecutor$Worker" , "exact" : false , "fileName" : "ThreadPoolExecutor.java" , "lineNumber" : 603, "methodName" : "run" }, { "className" : "java.lang. Thread " , "exact" : false , "fileName" : " Thread .java" , "lineNumber" : 722, "methodName" : "run" } ] }, "callStack" : [ { "className" : "org.apache.aries.blueprint.container.BlueprintContainerImpl" , "exact" : false , "fileName" : "BlueprintContainerImpl.java" , "lineNumber" : 409, "methodName" : "doRun" } ], "mdc" : { "bundle.id" : "7" , "bundle.version" : "1.0.1" , "application" : "berbatik_dev" , "bundle.name" : "org.apache.aries.blueprint.core" }, "threadInfo" : { "name" : "Blueprint Extender: 3" }, "loggerContext" : { "name" : "berbatik_dev" }, "timeStamp" : 1360493985973 } But I guess it's on Aries's side.
          Hide
          Hendy Irawan added a comment -

          Richard Hall's fix (https://issues.apache.org/jira/browse/FELIX-3242?focusedCommentId=13571524&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13571524) definitely helped.

          The #ARIES-954 bug still persists, HOWEVER:

          1. Using felix.framework 4.0.3, the bundle getting this exception will go into Failure state and this is practically irrecoverable, there are two options: A. uninstall then reinstall the bundle; B. restart Karaf

          2. Using org.apache.felix.framework-4.1.0-20130205.222907-15.jar, a simple "restart

          {bundle}

          " is now working to return the bundle back to Active-Created state!

          Progress!

          Show
          Hendy Irawan added a comment - Richard Hall's fix ( https://issues.apache.org/jira/browse/FELIX-3242?focusedCommentId=13571524&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13571524 ) definitely helped. The # ARIES-954 bug still persists, HOWEVER: 1. Using felix.framework 4.0.3, the bundle getting this exception will go into Failure state and this is practically irrecoverable, there are two options: A. uninstall then reinstall the bundle; B. restart Karaf 2. Using org.apache.felix.framework-4.1.0-20130205.222907-15.jar, a simple "restart {bundle} " is now working to return the bundle back to Active-Created state! Progress!
          Hide
          Hendy Irawan added a comment -

          Thanks!

          Show
          Hendy Irawan added a comment - Thanks!
          Hide
          Richard S. Hall added a comment -

          Should be able to...either framework.jar or felix.jar from main...whichever Karaf normally uses.

          Show
          Richard S. Hall added a comment - Should be able to...either framework.jar or felix.jar from main...whichever Karaf normally uses.
          Hide
          Hendy Irawan added a comment -

          Thank you Richard!

          To test it, I can just replace the felix.framework.jar on Karaf 2.3.0 with the latest snapshot?

          Show
          Hendy Irawan added a comment - Thank you Richard! To test it, I can just replace the felix.framework.jar on Karaf 2.3.0 with the latest snapshot?
          Hide
          Richard S. Hall added a comment -

          The issue here really is that some of the resolver state API is only intended to be called by the resolver implementation during a resolve operation. We were sort of treating these methods as if they could be called in another context, but they cannot. To try to deal with this situation, I've tried to provide better separation by keeping track of some data (resolver hooks in this case) in local variables that I pass around rather than have them as member variables. Please close if satisfied, thanks.

          Show
          Richard S. Hall added a comment - The issue here really is that some of the resolver state API is only intended to be called by the resolver implementation during a resolve operation. We were sort of treating these methods as if they could be called in another context, but they cannot. To try to deal with this situation, I've tried to provide better separation by keeping track of some data (resolver hooks in this case) in local variables that I pass around rather than have them as member variables. Please close if satisfied, thanks.
          Hide
          Hendy Irawan added a comment -

          I'm not sure if this is the same bug, but I'll add my stacktrace, using Karaf 2.3.0-SNAPSHOT and Aries Blueprint 0.3.2 :

          2012-08-15 07:09:45,081 | ERROR | rint Extender: 1 | BlueprintContainerImpl           | container.BlueprintContainerImpl  364 | 9 - org.apache.aries.blueprint - 0.3.2 | Unable to start blueprint container for bundle id.co.bippo.commerce.core
          java.util.ConcurrentModificationException
                  at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:390)[:1.7.0_03]
                  at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:401)[:1.7.0_03]
                  at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1067)[:1.7.0_03]
                  at org.apache.aries.blueprint.container.RecipeBuilder.createRepository(RecipeBuilder.java:87)[9:org.apache.aries.blueprint:0.3.2]
                  at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:495)[9:org.apache.aries.blueprint:0.3.2]
                  at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:320)[9:org.apache.aries.blueprint:0.3.2]
                  at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:230)[9:org.apache.aries.blueprint:0.3.2]
                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_03]
                  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_03]
                  at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_03]
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_03]
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_03]
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.7.0_03]
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.7.0_03]
                  at java.lang.Thread.run(Thread.java:722)[:1.7.0_03]
          
          Show
          Hendy Irawan added a comment - I'm not sure if this is the same bug, but I'll add my stacktrace, using Karaf 2.3.0-SNAPSHOT and Aries Blueprint 0.3.2 : 2012-08-15 07:09:45,081 | ERROR | rint Extender: 1 | BlueprintContainerImpl | container.BlueprintContainerImpl 364 | 9 - org.apache.aries.blueprint - 0.3.2 | Unable to start blueprint container for bundle id.co.bippo.commerce.core java.util.ConcurrentModificationException at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:390)[:1.7.0_03] at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:401)[:1.7.0_03] at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1067)[:1.7.0_03] at org.apache.aries.blueprint.container.RecipeBuilder.createRepository(RecipeBuilder.java:87)[9:org.apache.aries.blueprint:0.3.2] at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:495)[9:org.apache.aries.blueprint:0.3.2] at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:320)[9:org.apache.aries.blueprint:0.3.2] at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:230)[9:org.apache.aries.blueprint:0.3.2] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_03] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_03] at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_03] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_03] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_03] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.7.0_03] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.7.0_03] at java.lang. Thread .run( Thread .java:722)[:1.7.0_03]
          Hide
          Richard S. Hall added a comment -

          I see what is going on here, but I'm not sure the best way to resolve it yet.

          Basically, the current approach for implementing the R4.3 resolver hooks caches them at the beginning of a resolve operation and assumes that they are only accessed while holding the global lock, but this isn't true. They are also accessed in getCandidates() when trying to determine if a bundle should attempt a dynamic import, which purposely doesn't acquire the global lock to avoid lock contention for dynamic imports.

          I'll need to think about this some more.

          Show
          Richard S. Hall added a comment - I see what is going on here, but I'm not sure the best way to resolve it yet. Basically, the current approach for implementing the R4.3 resolver hooks caches them at the beginning of a resolve operation and assumes that they are only accessed while holding the global lock, but this isn't true. They are also accessed in getCandidates() when trying to determine if a bundle should attempt a dynamic import, which purposely doesn't acquire the global lock to avoid lock contention for dynamic imports. I'll need to think about this some more.

            People

            • Assignee:
              Richard S. Hall
              Reporter:
              David Jencks
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development