Yes, I see. For some reason, the repository is not finding a resource with
a capability that matches
(&(osgi.wiring.package=org.eclipse.jetty.continuation)(&(version>=8.1.0)(!(version>=9.0.0)))).
2013-02-12 15:50:42,071 DEBUG repository - Found providers in
org.jboss.osgi.repository.core.MavenArtifactRepository@7deb27fa: []
At least, I assume the [] indicates an empty Map for the return type.
Unfortunately, I'm not familiar with the repository implementation and
can't tell you why. Maybe there's an underlying issue being hidden by the
resolution exception? What happens if you add the jetty-continuation bundle
as content in the subsystem archive?
John
>
> AW: WG: Interaction of Subsystem-, Resolver- and Repository Service
>
> Thanks for the information. I’ve tried it as mentioned before but it
> doesn’t work.
> I wrapped the following bundle in a subsystem:
> - jetty-server-8.1.8.v20121106.jar
> Then I deployed the subsystem and I’ve got the following stack trace:
> 2013-02-12 15:50:42,071 DEBUG repository - Find providers for:
> org.apache.aries.subsystem.core.archive.ImportPackageRequirement:
> namespace=osgi.wiring.package, attributes={}, directives={filter=(&
> (osgi.wiring.package=org.eclipse.jetty.continuation)(&(version>=8.1.
> 0)(!(version>=9.0.0))))}, resource=/C:/Users/Christian/Desktop/
> Felix5-Test-Env/Jetty.esa/jetty-server-8.1.8.v20121106.jar
> 2013-02-12 15:50:42,071 DEBUG repository - Found providers in
> org.jboss.osgi.repository.core.MavenArtifactRepository@7deb27fa: []
> 2013-02-12 15:51:32,590 ERROR gofer-subsystem -
> [com.mwaysolutions.gofer2.SubsystemTracker] The activate method has
> thrown an exception
> org.osgi.service.subsystem.SubsystemException:
> org.osgi.service.resolver.ResolutionException: Unable to resolve /
> C:/Users/Christian/Desktop/Felix5-Test-Env/Jetty.esa/jetty-server-8.
> 1.8.v20121106.jar: missing requirement
> org.apache.aries.subsystem.core.archive.ImportPackageRequirement:
> namespace=osgi.wiring.package, attributes={}, directives={filter=(&
> (osgi.wiring.package=org.eclipse.jetty.continuation)(&(version>=8.1.
> 0)(!(version>=9.0.0))))}, resource=/C:/Users/Christian/Desktop/
> Felix5-Test-Env/Jetty.esa/jetty-server-8.1.8.v20121106.jar
> at
>
org.apache.aries.subsystem.core.internal.SubsystemResource.computeDependencies
> (SubsystemResource.java:416)
> at
>
org.apache.aries.subsystem.core.internal.SubsystemResource.computeDependencies
> (SubsystemResource.java:393)
> at
org.apache.aries.subsystem.core.internal.SubsystemResource.<init>(
> SubsystemResource.java:101)
> at
org.apache.aries.subsystem.core.internal.SubsystemResource.<init>(
> SubsystemResource.java:92)
> at
>
org.apache.aries.subsystem.core.internal.InstallAction.createSubsystemResource
> (InstallAction.java:128)
> at org.apache.aries.subsystem.core.internal.InstallAction.run(
> InstallAction.java:62)
> at org.apache.aries.subsystem.core.internal.InstallAction.run(
> InstallAction.java:31)
> at java.security.AccessController.doPrivileged(Native Method)
> at org.apache.aries.subsystem.core.internal.BasicSubsystem.install
(
> BasicSubsystem.java:642)
> at org.apache.aries.subsystem.core.internal.BasicSubsystem.install
(
> BasicSubsystem.java:260)
> at org.apache.aries.subsystem.core.internal.BasicSubsystem.install
(
> BasicSubsystem.java:254)
> at org.apache.aries.subsystem.core.internal.BasicSubsystem.install
(
> BasicSubsystem.java:66)
> at com.mwaysolutions.gofer2.SubsystemTracker.activate(
> SubsystemTracker.java:50)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(
> BaseMethod.java:227)
> at org.apache.felix.scr.impl.helper.BaseMethod.access$500(
> BaseMethod.java:38)
> at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(
> BaseMethod.java:591)
> at org.apache.felix.scr.impl.helper.BaseMethod.invoke(
> BaseMethod.java:472)
> at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(
> ActivateMethod.java:146)
> at
>
org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject
> (ImmediateComponentManager.java:226)
> at
>
org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent
(
> ImmediateComponentManager.java:118)
> at org.apache.felix.scr.impl.manager.AbstractComponentManager
> $Unsatisfied.activate(AbstractComponentManager.java:1013)
> at
>
org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal
(
> AbstractComponentManager.java:333)
> at
org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(
> AbstractComponentManager.java:157)
> at
>
org.apache.felix.scr.impl.config.ImmediateComponentHolder.enableComponents(
> ImmediateComponentHolder.java:313)
> at
org.apache.felix.scr.impl.BundleComponentActivator.loadDescriptor(
> BundleComponentActivator.java:253)
> at org.apache.felix.scr.impl.BundleComponentActivator.initialize(
> BundleComponentActivator.java:147)
> at org.apache.felix.scr.impl.BundleComponentActivator.<init>(
> BundleComponentActivator.java:111)
> at org.apache.felix.scr.impl.Activator.loadComponents(
> Activator.java:274)
> at org.apache.felix.scr.impl.Activator.bundleChanged
(Activator.java:192
> )
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(
> BundleContextImpl.java:847)
> at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(
> EventManager.java:230)
> at
>
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(
> ListenerQueue.java:148)
> at
>
org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged
> (Framework.java:1568)
> at
> org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(
> Framework.java:1504)
> at
> org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(
> Framework.java:1499)
> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker
(
> BundleHost.java:391)
> at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(
> AbstractBundle.java:390)
> at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle
(
> Framework.java:1176)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(
> StartLevelManager.java:559)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(
> StartLevelManager.java:544)
> at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(
> StartLevelManager.java:457)
> at
>
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(
> StartLevelManager.java:243)
> at
> org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalStart(
> EquinoxLauncher.java:271)
> at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.start(
> EquinoxLauncher.java:241)
> at org.eclipse.osgi.launch.Equinox.start(Equinox.java:258)
> at com.mwaysolutions.gofer2.gofer.Main.main(Main.java:47)
> Caused by: org.osgi.service.resolver.ResolutionException: Unable to
> resolve /C:/Users/Christian/Desktop/Felix5-Test-Env/Jetty.esa/jetty-
> server-8.1.8.v20121106.jar: missing requirement
> org.apache.aries.subsystem.core.archive.ImportPackageRequirement:
> namespace=osgi.wiring.package, attributes={}, directives={filter=(&
> (osgi.wiring.package=org.eclipse.jetty.continuation)(&(version>=8.1.
> 0)(!(version>=9.0.0))))}, resource=/C:/Users/Christian/Desktop/
> Felix5-Test-Env/Jetty.esa/jetty-server-8.1.8.v20121106.jar
> at org.apache.felix.resolver.Candidates.populateResource(
> Candidates.java:285)
> at org.apache.felix.resolver.Candidates.populate
(Candidates.java:153)
> at org.apache.felix.resolver.ResolverImpl.resolve
(ResolverImpl.java:96)
> at
>
org.apache.aries.subsystem.core.internal.SubsystemResource.computeDependencies
> (SubsystemResource.java:410)
> ... 49 more
> As you can see, MavenArtifactRepository is used to find the missing
> dependency osgi.wiring.package=org.eclipse.jetty.continuation)(&
> (version>=8.1.0)(!(version>=9.0.0). When I check the source code of
> MavenArtifactRepository there I can find two URLs:
> http://repository.jboss.org/nexus/content/groups/public
> http://repo1.maven.org/maven2
> the latter, maven central provides a bundle jetty-continuation which
> exports the necessary package. Why is it not working? Do I missed the
point?
> Thanks in advance. I appreciate your help very much.
> Christian
>
> By the way, if you're accustomed to using felix bundle repository
> (obr), there is an adapter in Aries that would allow you to continue
> using it with subsystems. You would need to install the
> org.apache.aries.subsystem.obr bundle separately (from the
> subsystem-obr project) as it's not included in the
> org.apache.aries.subsystem uber bundle you currently have installed.
>
> John
>
> >
> > Re: WG: Interaction of Subsystem-, Resolver- and Repository Service
> >
> > If you have any OSGi Resolver service registered, as well as at
> > least one OSGi Repository service registered containing resources
> > providing all required capabilities, installing a subsystem should
> > work "out of the box". You could certainly register your own OSGi
> > Repository service if you'd like. However, any compliant Repository
> > implementation capable of consuming your resources should be fine too.
> >
> > John
> >
> > >
> > > Re: WG: Interaction of Subsystem-, Resolver- and Repository Service
> > >
> > > Hi John,
> > >
> > > thanks for your fast reply. Actually, I don’t have an issue. I was
> > > just wondering that it really works so easy. ;) If I understood you
> > > correctly, then everything should work out of the box, right?
> > > In my case the third party bundles are missing in the local and
> > > system repository thus the repository service will be used by the
> > > resolver service. Once the impl is from JBoss it will search in
> > > Maven central and JBoss Nexus. As far as good, how can I provide my
> > > own repository? Do I have to implement my own Repository Service
> > > which points to my specific r5 repository or can I reuse any
> implementation?
> > >
> > > Thanks to point me to the specification. I’ve already read it twice
> > > and I think I’m familiar with the concept I was just confused that
> > > it is really so easy. I thought I have to do some further tweaks … J
> > >
> > > Thanks and cheers
> > >
> > > Christian
> > >
> > >
> > > Are you experiencing some sort of issue? For example, do you have a
> > > resource in a repository registered as a service but it's not being
> > > found by subsystems? Your setup looks okay. In terms of getting
> > > subsystems to interact with these services, all you need to do is
> > > ensure they're registered.
> > >
> > > The standard interactions between subsystems and other spec'd
> > > services such as resolver and repository are defined in the OSGi
> > > Enterprise R5 specification which may be found here: http://
> > > www.osgi.org/Specifications/HomePage. You may also find additional
> > > information in the Javadoc here: http://www.osgi.org/javadoc/r5/
> enterprise/.
> > >
> > > In a nutshell, when installing a subsystem, the implementation will
> > > use the felix resolver service (or the first resolver service it
> > > receives) to calculate dependencies. It will then search for
> > > resources that provide any missing dependencies using rules defined
> > > in the spec. As a gross generalization, these rules are (1) look for
> > > resources in the local repository (i.e. resources provided as part
> > > of the subsystem archive), (2) look for resources in the system
> > > repository (i.e. already installed resources) that provide
> > > dependencies in keeping with the isolation policy (this repository
> > > is not registered as a service but an internal implementation
> > > detail), (3) look for resources in registered repository services in
> > > service ranking order. For (3), the first repository providing a
> > > resource with a matching capability wins.
> > >
> > > Hope this helps.
> > >
> > > John
> > >
> > > >
> > > > Subject
> > > >
> > > > WG: Interaction of Subsystem-, Resolver- and Repository Service
> > > >
> > > > Hi,
> > > >
> > > > I want to use the Aries Subsystem implementation in combination
with
> > > > the Resolver- and Repository-Service. Actually, I don’t know how to
> > > > use the resolver and repo service from within my subsystem. I was
> > > > able to deploy and start bundles in an application- and feature
> > > > subsystem but in that case all necessary dependencies were
available
> > > > in the OSGi runtime. For the resolver I’m using Felix (0.1.0-
> > > > SNAPSHOT) and for the repo impl JBoss(jbosgi-repository-3.0.
> > > > 0.Alpha2.jar). However, when I check the code of the JBoss impl, it
> > > > seems like it’s working only with Maven central and JBoss nexus.
> > > > Anyway, I have no clue what to do that my subsystem interacts with
> > > > the resolver- and rep –service. If I check the service usage via
> > > > osgi shell, it seems that the subsystem impl has found all
> otherservices:
> > > >
> > > > g! inspect req service 56
> > > > org.apache.aries.subsystem_1.0.0.SNAPSHOT [56] require:
> > > > --------------------------------------------------------
> > > > service;
> > > > org.apache.aries.application.modelling.ModelledResourceManager
> > provided by:
> > > > org.apache.aries.application.modeller_1.0.0 [52]
> > > > service; org.osgi.service.coordinator.Coordinator provided by:
> > > > org.eclipse.equinox.coordinator_1.1.0.v20120522-1841 [73]
> > > > service; org.jboss.osgi.repository.XRepository,
> > > > org.osgi.service.repository.Repsitory provided by:
> > > > jbosgi-repository_3.0.0.Alpha2 [24]
> > > > service; org.eclipse.equinox.region.RegionDigraph provided by:
> > > > org.eclipse.equinox.region_1.1.0.v20120522-1841 [74]
> > > > service; org.osgi.service.coordinator.Coordinator provided by:
> > > > org.eclipse.equinox.coordinator_1.1.0.v20120522-1841 [73]
> > > > service; org.osgi.service.resolver.Resolver provided by:
> > > > org.apache.felix.resolver_0.1.0.r1400257 [69]
> > > > service; org.jboss.osgi.repository.XRepository,
> > > > org.osgi.service.repository.Repsitory provided by:
> > > > jbosgi-repository_3.0.0.Alpha2 [24]
> > > >
> > > > Furthermore, I want to use my own R5 compliant repo. For that I
> > > > found RepoIndex which generates repository indexes (index.xml)
> > > > compliant to R5. But I have no idea to configure the repo service
to
> > > > use my repository. I guess the latter point should be posted in the
> > > > JBoss Forum but it would be nice if someone can point me to a
manual
> > > > or something like that which explains how the interaction between
> > > > the subsystem service and all these other services works.
> > > >
> > > > Thanks in advance
> > > >
> > > > Cheers
> > > >
> > > > Christian Berger
> > > >
> > > > My current setup:
> > > >
> > > > org.apache.aries.application.api-1.0.0.jar
> > > > org.apache.aries.application.modeller-1.0.0.jar
> > > > org.apache.aries.application.utils-1.0.0.jar
> > > > org.apache.aries.blueprint-1.0.0.jar
> > > > org.apache.aries.proxy-1.0.1-20121031.092805-46.jar
> > > > org.apache.aries.subsystem-1.0.0-SNAPSHOT.jar
> > > > org.apache.aries.util-1.1.0-SNAPSHOT.jar
> > > > org.apache.felix.resolver-0.1.0-20121019.195943-6.jar
> > > > org.eclipse.equinox.coordinator-1.1.0.v20120522-1841.jar
> > > > org.eclipse.equinox.region-1.1.0.v20120522-1841.jar
> > > > osgi.enterprise-5.0.0.jar
> > > > jbosgi-repository-3.0.0.Alpha2.jar
> > > > jboss-logging-3.1.2.GA.jar
> > > > org.eclipse.osgi_3.8.1.v20120830-144521