You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Andreas Pieber (JIRA)" <ji...@apache.org> on 2012/06/06 11:39:22 UTC

[jira] [Created] (FELIX-3538) ConcurrentModificationException in StatefulResolver

Andreas Pieber created FELIX-3538:
-------------------------------------

             Summary: ConcurrentModificationException in StatefulResolver
                 Key: FELIX-3538
                 URL: https://issues.apache.org/jira/browse/FELIX-3538
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: framework-4.0.2
            Reporter: Andreas Pieber


I've just received the following felix exception after playing around with karaf 3 (using felix 4.0.2). Since I've done so already for about 1k times it's quite a rare one; nevertheless:

{code}
java.util.ConcurrentModificationException
        at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:819)[:1.7.0_03-icedtea]
        at java.util.ArrayList$Itr.next(ArrayList.java:791)[:1.7.0_03-icedtea]
        at org.apache.felix.framework.StatefulResolver$ResolverStateImpl.getCandidates(StatefulResolver.java:1333)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.StatefulResolver.isAllowedDynamicImport(StatefulResolver.java:521)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:216)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1539)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.2.jar:]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_03-icedtea]
        at org.ops4j.pax.exam.rbc.internal.Activator.bindRBC(Activator.java:144)[97:org.ops4j.pax.exam.rbc:2.4.0]
        at org.ops4j.pax.exam.rbc.internal.Activator.access$600(Activator.java:44)[97:org.ops4j.pax.exam.rbc:2.4.0]
        at org.ops4j.pax.exam.rbc.internal.Activator$2.call(Activator.java:125)[97:org.ops4j.pax.exam.rbc:2.4.0]
        at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)[97:org.ops4j.pax.exam.rbc:2.4.0]
        at org.ops4j.pax.exam.rbc.internal.Activator.register(Activator.java:109)[97:org.ops4j.pax.exam.rbc:2.4.0]
        at org.ops4j.pax.exam.rbc.internal.Activator.access$000(Activator.java:44)[97:org.ops4j.pax.exam.rbc:2.4.0]
        at org.ops4j.pax.exam.rbc.internal.Activator$1.run(Activator.java:89)[97:org.ops4j.pax.exam.rbc:2.4.0]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_03-icedtea]
{code}

--
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

        

[jira] [Commented] (FELIX-3538) ConcurrentModificationException in StatefulResolver

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290059#comment-13290059 ] 

Guillaume Nodet commented on FELIX-3538:
----------------------------------------

At first glance, it looks like the m_hooks list holding the resolver hooks is not synchronized at all.
I suppose using a CopyOnWriteArrayList instead of a simple ArrayList would work, especially as this list should not change very often.
                
> ConcurrentModificationException in StatefulResolver
> ---------------------------------------------------
>
>                 Key: FELIX-3538
>                 URL: https://issues.apache.org/jira/browse/FELIX-3538
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.2
>            Reporter: Andreas Pieber
>
> I've just received the following felix exception after playing around with karaf 3 (using felix 4.0.2). Since I've done so already for about 1k times it's quite a rare one; nevertheless:
> {code}
> java.util.ConcurrentModificationException
>         at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:819)[:1.7.0_03-icedtea]
>         at java.util.ArrayList$Itr.next(ArrayList.java:791)[:1.7.0_03-icedtea]
>         at org.apache.felix.framework.StatefulResolver$ResolverStateImpl.getCandidates(StatefulResolver.java:1333)[org.apache.felix.framework-4.0.2.jar:]
>         at org.apache.felix.framework.StatefulResolver.isAllowedDynamicImport(StatefulResolver.java:521)[org.apache.felix.framework-4.0.2.jar:]
>         at org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:216)[org.apache.felix.framework-4.0.2.jar:]
>         at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1539)[org.apache.felix.framework-4.0.2.jar:]
>         at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)[org.apache.felix.framework-4.0.2.jar:]
>         at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.2.jar:]
>         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.2.jar:]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_03-icedtea]
>         at org.ops4j.pax.exam.rbc.internal.Activator.bindRBC(Activator.java:144)[97:org.ops4j.pax.exam.rbc:2.4.0]
>         at org.ops4j.pax.exam.rbc.internal.Activator.access$600(Activator.java:44)[97:org.ops4j.pax.exam.rbc:2.4.0]
>         at org.ops4j.pax.exam.rbc.internal.Activator$2.call(Activator.java:125)[97:org.ops4j.pax.exam.rbc:2.4.0]
>         at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)[97:org.ops4j.pax.exam.rbc:2.4.0]
>         at org.ops4j.pax.exam.rbc.internal.Activator.register(Activator.java:109)[97:org.ops4j.pax.exam.rbc:2.4.0]
>         at org.ops4j.pax.exam.rbc.internal.Activator.access$000(Activator.java:44)[97:org.ops4j.pax.exam.rbc:2.4.0]
>         at org.ops4j.pax.exam.rbc.internal.Activator$1.run(Activator.java:89)[97:org.ops4j.pax.exam.rbc:2.4.0]
>         at java.lang.Thread.run(Thread.java:722)[:1.7.0_03-icedtea]
> {code}

--
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