GitHub user neykov opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/90

    OSGi class loading fixes

      * Changes the way bundles on the classpath are exported to felix - from 
list of exported packages in system.packages.extra to building extension 
bundles for each bundle on the classpath. This avoids the case where the same 
class would be loaded once from the classpath and once from a bundle referenced 
by a catalog item. When the catalog item tries to install the bundle we see 
that there is already an existing version installed and use it instead.
      * AggregateClassLoader doesn't relay to parent, using only the explicitly 
registered classloaders.
      * Force maven-bundle-plugin to include \*.impl.\* and \*.internal.\* 
packages in the export-package list (referenced between brooklyn bundles)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/neykov/incubator-brooklyn osgi-fixes

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/90.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #90
    
----
commit 6b3930415accb53e08345e323da1f2330defdcf4
Author: Svetoslav Neykov <[email protected]>
Date:   2014-07-23T15:21:20Z

    writeToTempFile should follow the semantics of newTempFile
    
    Os.*TempFile methods would be expected to behave in a similar manner.
    Use newTempFile which will normalize prefix/suffix arguments.

commit 998080399b8c00f721ee771b44a1e6f48d925886
Author: Svetoslav Neykov <[email protected]>
Date:   2014-07-23T15:25:02Z

    AggregateClassLoader shouldn't relay requests to the parent.
    
    A normal class loading first goes through the parent class loaders and
    if that fails then findClass will be called. In the aggregate case we have
    already explicitly listed all classloaders we want to try. Don't try to load
    classes from parent.

commit 812bf260c009498cb8f9f2577c88716e435a143b
Author: Svetoslav Neykov <[email protected]>
Date:   2014-07-23T15:48:58Z

    Resolve classloading issues related to OSGi.
    
    The changes should make it impossible to have the same
    class loaded from different classloaders resulting in linker
    errors. For example a catalog item could load a class from
    one of its linked bundles, while the same class would be available
    on the app classpath where it was already loaded.
    
    The solution is to make sure that a bundle is loaded exactly once.
    While this is normally the case we were having issues with bundles
    included in the boot classpath. We were exporting their packages
    but the framework didn't know which bundle name:version they
    belonged to, thus making it possible to load the same bundle from
    external source.
    
    Instead of including the exported packages of bundles on the
    classpath to the system.packages.extra config, now for each bundle
    on the classpath an extension bundle will be created and installed.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to