aries-dev mailing list archives

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

     [ https://issues.apache.org/jira/browse/ARIES-927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

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: https://issues.apache.org/jira/browse/ARIES-927
>             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(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