aries-dev mailing list archives

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


David Jencks commented on ARIES-927:

There's already an attempt to figure out whether composite bundles are supported in the RecursiveBundleTracker:

    private static boolean areMultipleFrameworksAvailable(BundleContext context) {
        ServiceReference sr = context.getServiceReference("org.osgi.service.framework.CompositeBundleFactory");
        return sr != null;

and we don't create an InternalRecursiveBundleTracker if this services isn't available.  I'm
not sure I understand the context you are in, would it be better to update this test to try
to load CompositeBundle like your test does?  I think if CompositeBundle is not loadable we
don't want to try to create this tracker, just use one of the others.
> 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.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