aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Jencks (JIRA)" <j...@apache.org>
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

    [ https://issues.apache.org/jira/browse/ARIES-927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463563#comment-13463563
] 

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: https://issues.apache.org/jira/browse/ARIES-927
>             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(BundleContextImpl.java:734)
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
> 	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
> 	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
> 	at aQute.launcher.Launcher.update(Launcher.java:287)
> 	at aQute.launcher.Launcher.activate(Launcher.java:212)
> 	at aQute.launcher.Launcher.run(Launcher.java:133)
> 	at aQute.launcher.Launcher.main(Launcher.java:68)
> Caused by: java.lang.NoClassDefFoundError: org/osgi/service/framework/CompositeBundle
> 	at org.apache.aries.util.tracker.InternalRecursiveBundleTracker.addingBundle(InternalRecursiveBundleTracker.java:67)
> 	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:467)
> 	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1)
> 	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
> 	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
> 	at org.osgi.util.tracker.BundleTracker.open(BundleTracker.java:156)
> 	at org.apache.aries.util.tracker.RecursiveBundleTracker.open(RecursiveBundleTracker.java:95)
> 	at org.apache.aries.blueprint.container.BlueprintExtender$2.serviceFound(BlueprintExtender.java:104)
> 	at org.apache.aries.util.tracker.SingleServiceTracker.update(SingleServiceTracker.java:157)
> 	at org.apache.aries.util.tracker.SingleServiceTracker.findMatchingReference(SingleServiceTracker.java:115)
> 	at org.apache.aries.util.tracker.SingleServiceTracker.open(SingleServiceTracker.java:98)
> 	at org.apache.aries.blueprint.container.BlueprintExtender.start(BlueprintExtender.java:112)
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
> 	... 7 more
> Caused by: java.lang.ClassNotFoundException: org.osgi.service.framework.CompositeBundle
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
> 	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> 	... 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: http://www.atlassian.com/software/jira

Mime
View raw message