aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Ross (JIRA)" <>
Subject [jira] [Updated] (ARIES-927) Imports org.osgi.service.framework package as optional but assumes it's there nevertheless.
Date Wed, 26 Sep 2012 12:53:07 GMT


John Ross updated ARIES-927:

    Attachment: aries927-areMultipleFrameworksAvailable.patch

Yes, I see what you're saying. The BlueprintExtender creates a RecursiveBundleTracker which
won't create an InternalRecursiveBundleTracker if areMultipleFrameworksAvailable() returns
false. However, the current check there is not sufficient because Equinox will register the
org.osgi.service.framework.CompositeBundleFactory service even though the corresponding package
is x-internal and resolution mode is strict. So the service is there, but the Util bundle
does not have access to the org.osgi.service.framework package. Moving the additional check
to RecursiveBundleTracker.areMultipleFrameworksAvailable() solves the issue just as well and
is fine with me. The latest patch incorporates that idea and would replace the previous patch.
> Imports org.osgi.service.framework package as optional but assumes it's there nevertheless.
> -------------------------------------------------------------------------------------------
>                 Key: ARIES-927
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: Util
>            Reporter: John Ross
>         Attachments: aries927-areMultipleFrameworksAvailable.patch, aries927.patch
> Util imports the org.osgi.service.framework package as optional. However, the InternalRecursiveBundleTracker
invokes "x instanceof CompositeBundle" in the addingBundle() method without protection. This
results in a NoClassDefFoundError, like the one below, in environments where the package is
not available. One such environment is the OSGi CT, where "private" package imports, such
as the x-internal org.osgi.service.framework package provided by Equinox, are forbidden.
> ! Failed to start bundle org.apache.aries.blueprint-1.0.0, exception activator error
org/osgi/service/framework/CompositeBundle from: org.apache.aries.util.tracker.InternalRecursiveBundleTracker:addingBundle#67
> org.osgi.framework.BundleException: Exception in org.apache.aries.blueprint.container.BlueprintExtender.start()
of bundle org.apache.aries.blueprint.
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(
> 	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(
> 	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(
> 	at aQute.launcher.Launcher.update(
> 	at aQute.launcher.Launcher.activate(
> 	at
> 	at aQute.launcher.Launcher.main(
> Caused by: java.lang.NoClassDefFoundError: org/osgi/service/framework/CompositeBundle
> 	at org.apache.aries.util.tracker.InternalRecursiveBundleTracker.addingBundle(
> 	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(
> 	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(
> 	at org.osgi.util.tracker.AbstractTracked.trackAdding(
> 	at org.osgi.util.tracker.AbstractTracked.trackInitial(
> 	at
> 	at
> 	at org.apache.aries.blueprint.container.BlueprintExtender$2.serviceFound(
> 	at org.apache.aries.util.tracker.SingleServiceTracker.update(
> 	at org.apache.aries.util.tracker.SingleServiceTracker.findMatchingReference(
> 	at
> 	at org.apache.aries.blueprint.container.BlueprintExtender.start(
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$
> 	at Method)
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(
> 	... 7 more
> Caused by: java.lang.ClassNotFoundException: org.osgi.service.framework.CompositeBundle
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
> 	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
> 	at java.lang.ClassLoader.loadClass(
> 	... 22 more

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message