[ 
https://issues.apache.org/jira/browse/CAMEL-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972929#action_12972929
 ] 

Claus Ibsen commented on CAMEL-3442:
------------------------------------

Thanks Freeman

I think we should fix this in the core, so it returns a new set when invoking 
{{getClassLoaders}}, that will fix this issue for other custom package scan 
resolvers that may encounter similar issue.

Something like this:
{code}
    public Set<ClassLoader> getClassLoaders() {
        // return a new set to avoid any concurrency issues in other runtimes 
such as OSGi
        return new LinkedHashSet<ClassLoader>(classLoaders);
    }
{code}

> JBI ClassLoading issue in SMX 4.x in OsgiPackageScanClassResolver
> -----------------------------------------------------------------
>
>                 Key: CAMEL-3442
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3442
>             Project: Camel
>          Issue Type: Bug
>          Components: osgi
>    Affects Versions: 2.5.0
>            Reporter: Claus Ibsen
>             Fix For: 2.6.0
>
>
> CAMEL-3302 introduced a fallback when using JBI in Apache ServiceMix 4.x.
> However it may lead to an issue with ConcurrentModificationException when 
> traversing the list of classloaders.
> {code}
>             for (ClassLoader classLoader : super.getClassLoaders()) {
>                 if (!isOsgiClassloader(classLoader)) {
>                     find(test, packageName, classLoader, classes);
>                 }
>             }  
> {code}
> The for loop is line 62 which causes the exception.
> Issue reported here
> http://camel.465427.n5.nabble.com/ServiceMix-4-Fuse-4-3-0-fuse-03-00-Problems-running-JBI-example-examples-camel-td3309088.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to