Wiring issue

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Wiring issue

Greg Logan
Hi all,

I'm hitting a very strange wiring issue with our features.  The error I'm seeing look like this:

>feature:install opencast-adminpresentation
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=opencast-adminpresentation; type=karaf.feature; version="[0,0.0.0]"; filter:="(&(osgi.identity=opencast-adminpresentation)(type=karaf.feature)(version>=0.0.0)(version<=0.0.0))" [caused by: Unable to resolve opencast-adminpresentation/0.0.0: missing requirement [opencast-adminpresentation/0.0.0] osgi.identity; osgi.identity=opencast-engage-ui; type=osgi.bundle; version="[6.6.0,6.6.0]"; resolution:=mandatory [caused by: Unable to resolve opencast-engage-ui/6.6.0: missing requirement [opencast-engage-ui/6.6.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=javax.ws.rs)(version>=1.1.0)(!(version>=2.0.0)))"]]
        at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:391)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:377)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:349)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1188)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1086)[6:org.apache.karaf.features.core:4.0.10]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748)[:1.8.0_222]

This occurs on three of our profiles, all involving the opencast-engage-ui bundle.  The odd part is that this appears in our 6.6 version, but *not* our 6.5 - but there's no part of the changeset between 6.5[1] and 6.6[2] which should be causing this.  We're using the servicemix bundle[3], which is the same across both of our 6.5 and 6.6 versions.  The bundle headers for 6.5 look like this:

>bundle:headers opencast-engage-ui

Opencast :: engage-ui (345)
---------------------------
Bnd-LastModified = 1560502504114
Build-Jdk = 1.8.0_212
Build-Number = 618eec6
Built-By = lars
Created-By = Apache Maven Bundle Plugin
Http-Alias = /engage/ui
Http-Classpath = /ui
Http-Welcome = index.html
Manifest-Version = 1.0
Tool = Bnd-3.5.0.201709291849

Bundle-Category = opencastproject
Bundle-Description = Opencast is a media capture, processing, management and distribution system
Bundle-DocURL = http://opencastproject.org/
Bundle-License = http://www.osedu.org/licenses/ECL-2.0/ecl2.txt
Bundle-ManifestVersion = 2
Bundle-Name = Opencast :: engage-ui
Bundle-SymbolicName = opencast-engage-ui
Bundle-Vendor = The Opencast Project
Bundle-Version = 6.5.0

But I'm not sure how to get the headers for 6.6 since the feature won't even start :(

Any clues about how to proceed here?

Thanks,
G

3: mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr339-api-2.0.1/2.6.0
Reply | Threaded
Open this post in threaded view
|

Re: Wiring issue

cschneider
You seem to be using the spec bundle :
org.apache.servicemix.specs.jsr339-api-2.0.1
This has
Export-Package: javax.ws.rs;version="2.0.1"
This version is outside the range < 2 you are looking for in your bundle.
So the question is of course why a spec bundle exports a 2.0.1 version of this package. Maybe there is an error in the servicemix bundle.

As a quick fix you can allow a package import >2 is your ui bundle.

Christian


Am Fr., 13. Sept. 2019 um 23:24 Uhr schrieb Greg Logan <[hidden email]>:
Hi all,

I'm hitting a very strange wiring issue with our features.  The error I'm seeing look like this:

>feature:install opencast-adminpresentation
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=opencast-adminpresentation; type=karaf.feature; version="[0,0.0.0]"; filter:="(&(osgi.identity=opencast-adminpresentation)(type=karaf.feature)(version>=0.0.0)(version<=0.0.0))" [caused by: Unable to resolve opencast-adminpresentation/0.0.0: missing requirement [opencast-adminpresentation/0.0.0] osgi.identity; osgi.identity=opencast-engage-ui; type=osgi.bundle; version="[6.6.0,6.6.0]"; resolution:=mandatory [caused by: Unable to resolve opencast-engage-ui/6.6.0: missing requirement [opencast-engage-ui/6.6.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=javax.ws.rs)(version>=1.1.0)(!(version>=2.0.0)))"]]
        at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:391)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:377)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:349)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1188)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1086)[6:org.apache.karaf.features.core:4.0.10]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748)[:1.8.0_222]

This occurs on three of our profiles, all involving the opencast-engage-ui bundle.  The odd part is that this appears in our 6.6 version, but *not* our 6.5 - but there's no part of the changeset between 6.5[1] and 6.6[2] which should be causing this.  We're using the servicemix bundle[3], which is the same across both of our 6.5 and 6.6 versions.  The bundle headers for 6.5 look like this:

>bundle:headers opencast-engage-ui

Opencast :: engage-ui (345)
---------------------------
Bnd-LastModified = 1560502504114
Build-Jdk = 1.8.0_212
Build-Number = 618eec6
Built-By = lars
Created-By = Apache Maven Bundle Plugin
Http-Alias = /engage/ui
Http-Classpath = /ui
Http-Welcome = index.html
Manifest-Version = 1.0
Tool = Bnd-3.5.0.201709291849

Bundle-Category = opencastproject
Bundle-Description = Opencast is a media capture, processing, management and distribution system
Bundle-DocURL = http://opencastproject.org/
Bundle-License = http://www.osedu.org/licenses/ECL-2.0/ecl2.txt
Bundle-ManifestVersion = 2
Bundle-Name = Opencast :: engage-ui
Bundle-SymbolicName = opencast-engage-ui
Bundle-Vendor = The Opencast Project
Bundle-Version = 6.5.0

But I'm not sure how to get the headers for 6.6 since the feature won't even start :(

Any clues about how to proceed here?

Thanks,
G

3: mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr339-api-2.0.1/2.6.0


--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist

Reply | Threaded
Open this post in threaded view
|

Re: Wiring issue

jbonofre
Hi Christian,

good point about the jsr339 spec bundle. My fault ;)

I will update the export.

Regards
JB

On 16/09/2019 10:19, Christian Schneider wrote:

> You seem to be using the spec bundle :
> org.apache.servicemix.specs.jsr339-api-2.0.1
> This has
> Export-Package: javax.ws.rs <http://javax.ws.rs>;version="2.0.1"
> This version is outside the range < 2 you are looking for in your bundle.
> So the question is of course why a spec bundle exports a 2.0.1 version
> of this package. Maybe there is an error in the servicemix bundle.
>
> As a quick fix you can allow a package import >2 is your ui bundle.
>
> Christian
>
>
> Am Fr., 13. Sept. 2019 um 23:24 Uhr schrieb Greg Logan
> <[hidden email] <mailto:[hidden email]>>:
>
>     Hi all,
>
>     I'm hitting a very strange wiring issue with our features.  The
>     error I'm seeing look like this:
>
>     >feature:install opencast-adminpresentation
>     org.osgi.service.resolver.ResolutionException: Unable to resolve
>     root: missing requirement [root] osgi.identity;
>     osgi.identity=opencast-adminpresentation; type=karaf.feature;
>     version="[0,0.0.0]";
>     filter:="(&(osgi.identity=opencast-adminpresentation)(type=karaf.feature)(version>=0.0.0)(version<=0.0.0))"
>     [caused by: Unable to resolve opencast-adminpresentation/0.0.0:
>     missing requirement [opencast-adminpresentation/0.0.0]
>     osgi.identity; osgi.identity=opencast-engage-ui; type=osgi.bundle;
>     version="[6.6.0,6.6.0]"; resolution:=mandatory [caused by: Unable to
>     resolve opencast-engage-ui/6.6.0: missing requirement
>     [opencast-engage-ui/6.6.0] osgi.wiring.package;
>     filter:="(&(osgi.wiring.package=javax.ws.rs
>     <http://javax.ws.rs>)(version>=1.1.0)(!(version>=2.0.0)))"]]
>             at
>     org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[6:org.apache.karaf.features.core:4.0.10]
>             at
>     org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:391)[6:org.apache.karaf.features.core:4.0.10]
>             at
>     org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:377)[6:org.apache.karaf.features.core:4.0.10]
>             at
>     org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:349)[6:org.apache.karaf.features.core:4.0.10]
>             at
>     org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)[6:org.apache.karaf.features.core:4.0.10]
>             at
>     org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[6:org.apache.karaf.features.core:4.0.10]
>             at
>     org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1188)[6:org.apache.karaf.features.core:4.0.10]
>             at
>     org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1086)[6:org.apache.karaf.features.core:4.0.10]
>             at
>     java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_222]
>             at
>     java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_222]
>             at
>     java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_222]
>             at java.lang.Thread.run(Thread.java:748)[:1.8.0_222]
>
>     This occurs on three of our profiles, all involving the
>     opencast-engage-ui bundle.  The odd part is that this appears in our
>     6.6 version, but *not* our 6.5 - but there's no part of the
>     changeset between 6.5[1] and 6.6[2] which should be causing this. 
>     We're using the servicemix bundle[3], which is the same across both
>     of our 6.5 and 6.6 versions.  The bundle headers for 6.5 look like this:
>
>     >bundle:headers opencast-engage-ui
>
>     Opencast :: engage-ui (345)
>     ---------------------------
>     Bnd-LastModified = 1560502504114
>     Build-Jdk = 1.8.0_212
>     Build-Number = 618eec6
>     Built-By = lars
>     Created-By = Apache Maven Bundle Plugin
>     Http-Alias = /engage/ui
>     Http-Classpath = /ui
>     Http-Welcome = index.html
>     Manifest-Version = 1.0
>     Tool = Bnd-3.5.0.201709291849
>
>     Bundle-Category = opencastproject
>     Bundle-Description = Opencast is a media capture, processing,
>     management and distribution system
>     Bundle-DocURL = http://opencastproject.org/
>     Bundle-License = http://www.osedu.org/licenses/ECL-2.0/ecl2.txt
>     Bundle-ManifestVersion = 2
>     Bundle-Name = Opencast :: engage-ui
>     Bundle-SymbolicName = opencast-engage-ui
>     Bundle-Vendor = The Opencast Project
>     Bundle-Version = 6.5.0
>
>     But I'm not sure how to get the headers for 6.6 since the feature
>     won't even start :(
>
>     Any clues about how to proceed here?
>
>     Thanks,
>     G
>
>     1: https://github.com/opencast/opencast/releases/tag/6.5
>     2: https://github.com/opencast/opencast/releases/tag/6.6
>     3: mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr339-api-2.0.1/2.6.0
>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Computer Scientist
> http://www.adobe.com
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Wiring issue

Greg Logan
In reply to this post by cschneider
Hi Christian,

That's the really odd part: Neither the module pom (6.5: [1], 6.6: [2]), nor the main pom (6.5: [3]. 6.6: [4]) make any restriction on the package version.  Is there a way to enumerate which bits are imposing which restrictions?  

G



On Mon, Sep 16, 2019 at 2:20 AM Christian Schneider <[hidden email]> wrote:
You seem to be using the spec bundle :
org.apache.servicemix.specs.jsr339-api-2.0.1
This has
Export-Package: javax.ws.rs;version="2.0.1"
This version is outside the range < 2 you are looking for in your bundle.
So the question is of course why a spec bundle exports a 2.0.1 version of this package. Maybe there is an error in the servicemix bundle.

As a quick fix you can allow a package import >2 is your ui bundle.

Christian


Am Fr., 13. Sept. 2019 um 23:24 Uhr schrieb Greg Logan <[hidden email]>:
Hi all,

I'm hitting a very strange wiring issue with our features.  The error I'm seeing look like this:

>feature:install opencast-adminpresentation
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=opencast-adminpresentation; type=karaf.feature; version="[0,0.0.0]"; filter:="(&(osgi.identity=opencast-adminpresentation)(type=karaf.feature)(version>=0.0.0)(version<=0.0.0))" [caused by: Unable to resolve opencast-adminpresentation/0.0.0: missing requirement [opencast-adminpresentation/0.0.0] osgi.identity; osgi.identity=opencast-engage-ui; type=osgi.bundle; version="[6.6.0,6.6.0]"; resolution:=mandatory [caused by: Unable to resolve opencast-engage-ui/6.6.0: missing requirement [opencast-engage-ui/6.6.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=javax.ws.rs)(version>=1.1.0)(!(version>=2.0.0)))"]]
        at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:391)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:377)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:349)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1188)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1086)[6:org.apache.karaf.features.core:4.0.10]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748)[:1.8.0_222]

This occurs on three of our profiles, all involving the opencast-engage-ui bundle.  The odd part is that this appears in our 6.6 version, but *not* our 6.5 - but there's no part of the changeset between 6.5[1] and 6.6[2] which should be causing this.  We're using the servicemix bundle[3], which is the same across both of our 6.5 and 6.6 versions.  The bundle headers for 6.5 look like this:

>bundle:headers opencast-engage-ui

Opencast :: engage-ui (345)
---------------------------
Bnd-LastModified = 1560502504114
Build-Jdk = 1.8.0_212
Build-Number = 618eec6
Built-By = lars
Created-By = Apache Maven Bundle Plugin
Http-Alias = /engage/ui
Http-Classpath = /ui
Http-Welcome = index.html
Manifest-Version = 1.0
Tool = Bnd-3.5.0.201709291849

Bundle-Category = opencastproject
Bundle-Description = Opencast is a media capture, processing, management and distribution system
Bundle-DocURL = http://opencastproject.org/
Bundle-License = http://www.osedu.org/licenses/ECL-2.0/ecl2.txt
Bundle-ManifestVersion = 2
Bundle-Name = Opencast :: engage-ui
Bundle-SymbolicName = opencast-engage-ui
Bundle-Vendor = The Opencast Project
Bundle-Version = 6.5.0

But I'm not sure how to get the headers for 6.6 since the feature won't even start :(

Any clues about how to proceed here?

Thanks,
G

3: mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr339-api-2.0.1/2.6.0


--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist

Reply | Threaded
Open this post in threaded view
|

Re: Wiring issue

cschneider
By default the maven bundle plugin introspects your classes and the jars in the maven build. 
If you need a package then an import is created. If the jar offering the packge has an OSGi Manifest then the version is taken from there if not then it uses the maven version as package version.
From this version bnd computes the import range. By default it uses the exported version above cut to the minor version until excluding the next major version.

You use this rs api to build your project:

      <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>jsr311-api</artifactId>
        <version>1.1.1</version>
      </dependency>

So for example for the rs import it detrmined version 1.1.1 from the api jar. The jar has no OSGi metadata.
So this creates an import range [1.1, 2).

The servicemix bundle for the spec exports version 2.0.1 which is outside the spec.
You can configure the package imports by hand in <configuration><instructions>.
This is fragile though.

One simple workaround is to use the servicemix spec bundle in your maven build instead of the one you used.
JB mentioned that the exports of the servicemix bundle might be wrong. Actually I do not know which exports would be correct. Spec bundles do not always follow the semantic versioning.
So if you use the seervicemix jar be prepared to readjust if JB fixes the export version.

There is also a difference in your specs to the one karaf offers. You used jsr311 which I think is jax rs 2.0 while karaf offers jax rs 2.1. Normally of course this should be compatible. 

@JB I have no idea what the correct exports should be. I hope this is defined in some OSGi spec.

Christian

Am Mo., 16. Sept. 2019 um 23:34 Uhr schrieb Greg Logan <[hidden email]>:
Hi Christian,

That's the really odd part: Neither the module pom (6.5: [1], 6.6: [2]), nor the main pom (6.5: [3]. 6.6: [4]) make any restriction on the package version.  Is there a way to enumerate which bits are imposing which restrictions?  

G



On Mon, Sep 16, 2019 at 2:20 AM Christian Schneider <[hidden email]> wrote:
You seem to be using the spec bundle :
org.apache.servicemix.specs.jsr339-api-2.0.1
This has
Export-Package: javax.ws.rs;version="2.0.1"
This version is outside the range < 2 you are looking for in your bundle.
So the question is of course why a spec bundle exports a 2.0.1 version of this package. Maybe there is an error in the servicemix bundle.

As a quick fix you can allow a package import >2 is your ui bundle.

Christian


Am Fr., 13. Sept. 2019 um 23:24 Uhr schrieb Greg Logan <[hidden email]>:
Hi all,

I'm hitting a very strange wiring issue with our features.  The error I'm seeing look like this:

>feature:install opencast-adminpresentation
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=opencast-adminpresentation; type=karaf.feature; version="[0,0.0.0]"; filter:="(&(osgi.identity=opencast-adminpresentation)(type=karaf.feature)(version>=0.0.0)(version<=0.0.0))" [caused by: Unable to resolve opencast-adminpresentation/0.0.0: missing requirement [opencast-adminpresentation/0.0.0] osgi.identity; osgi.identity=opencast-engage-ui; type=osgi.bundle; version="[6.6.0,6.6.0]"; resolution:=mandatory [caused by: Unable to resolve opencast-engage-ui/6.6.0: missing requirement [opencast-engage-ui/6.6.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=javax.ws.rs)(version>=1.1.0)(!(version>=2.0.0)))"]]
        at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:391)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:377)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:349)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1188)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1086)[6:org.apache.karaf.features.core:4.0.10]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748)[:1.8.0_222]

This occurs on three of our profiles, all involving the opencast-engage-ui bundle.  The odd part is that this appears in our 6.6 version, but *not* our 6.5 - but there's no part of the changeset between 6.5[1] and 6.6[2] which should be causing this.  We're using the servicemix bundle[3], which is the same across both of our 6.5 and 6.6 versions.  The bundle headers for 6.5 look like this:

>bundle:headers opencast-engage-ui

Opencast :: engage-ui (345)
---------------------------
Bnd-LastModified = 1560502504114
Build-Jdk = 1.8.0_212
Build-Number = 618eec6
Built-By = lars
Created-By = Apache Maven Bundle Plugin
Http-Alias = /engage/ui
Http-Classpath = /ui
Http-Welcome = index.html
Manifest-Version = 1.0
Tool = Bnd-3.5.0.201709291849

Bundle-Category = opencastproject
Bundle-Description = Opencast is a media capture, processing, management and distribution system
Bundle-DocURL = http://opencastproject.org/
Bundle-License = http://www.osedu.org/licenses/ECL-2.0/ecl2.txt
Bundle-ManifestVersion = 2
Bundle-Name = Opencast :: engage-ui
Bundle-SymbolicName = opencast-engage-ui
Bundle-Vendor = The Opencast Project
Bundle-Version = 6.5.0

But I'm not sure how to get the headers for 6.6 since the feature won't even start :(

Any clues about how to proceed here?

Thanks,
G

3: mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr339-api-2.0.1/2.6.0


--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist



--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist

Reply | Threaded
Open this post in threaded view
|

Re: Wiring issue

Greg Logan
Ah! I had not considered that the next major version would automatically populate the ceiling of the version info. That makes a ton more sense.

That being said, I've worked around this by rebuilding the tarballs until I got a set that works. Go figure. I'll check our newer versions to make sure this works properly going forward though. 

Thanks for the help!

G

On Tue, Sep 17, 2019, 00:26 Christian Schneider, <[hidden email]> wrote:
By default the maven bundle plugin introspects your classes and the jars in the maven build. 
If you need a package then an import is created. If the jar offering the packge has an OSGi Manifest then the version is taken from there if not then it uses the maven version as package version.
From this version bnd computes the import range. By default it uses the exported version above cut to the minor version until excluding the next major version.

You use this rs api to build your project:

      <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>jsr311-api</artifactId>
        <version>1.1.1</version>
      </dependency>

So for example for the rs import it detrmined version 1.1.1 from the api jar. The jar has no OSGi metadata.
So this creates an import range [1.1, 2).

The servicemix bundle for the spec exports version 2.0.1 which is outside the spec.
You can configure the package imports by hand in <configuration><instructions>.
This is fragile though.

One simple workaround is to use the servicemix spec bundle in your maven build instead of the one you used.
JB mentioned that the exports of the servicemix bundle might be wrong. Actually I do not know which exports would be correct. Spec bundles do not always follow the semantic versioning.
So if you use the seervicemix jar be prepared to readjust if JB fixes the export version.

There is also a difference in your specs to the one karaf offers. You used jsr311 which I think is jax rs 2.0 while karaf offers jax rs 2.1. Normally of course this should be compatible. 

@JB I have no idea what the correct exports should be. I hope this is defined in some OSGi spec.

Christian

Am Mo., 16. Sept. 2019 um 23:34 Uhr schrieb Greg Logan <[hidden email]>:
Hi Christian,

That's the really odd part: Neither the module pom (6.5: [1], 6.6: [2]), nor the main pom (6.5: [3]. 6.6: [4]) make any restriction on the package version.  Is there a way to enumerate which bits are imposing which restrictions?  

G



On Mon, Sep 16, 2019 at 2:20 AM Christian Schneider <[hidden email]> wrote:
You seem to be using the spec bundle :
org.apache.servicemix.specs.jsr339-api-2.0.1
This has
Export-Package: javax.ws.rs;version="2.0.1"
This version is outside the range < 2 you are looking for in your bundle.
So the question is of course why a spec bundle exports a 2.0.1 version of this package. Maybe there is an error in the servicemix bundle.

As a quick fix you can allow a package import >2 is your ui bundle.

Christian


Am Fr., 13. Sept. 2019 um 23:24 Uhr schrieb Greg Logan <[hidden email]>:
Hi all,

I'm hitting a very strange wiring issue with our features.  The error I'm seeing look like this:

>feature:install opencast-adminpresentation
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=opencast-adminpresentation; type=karaf.feature; version="[0,0.0.0]"; filter:="(&(osgi.identity=opencast-adminpresentation)(type=karaf.feature)(version>=0.0.0)(version<=0.0.0))" [caused by: Unable to resolve opencast-adminpresentation/0.0.0: missing requirement [opencast-adminpresentation/0.0.0] osgi.identity; osgi.identity=opencast-engage-ui; type=osgi.bundle; version="[6.6.0,6.6.0]"; resolution:=mandatory [caused by: Unable to resolve opencast-engage-ui/6.6.0: missing requirement [opencast-engage-ui/6.6.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=javax.ws.rs)(version>=1.1.0)(!(version>=2.0.0)))"]]
        at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:391)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:377)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:349)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1188)[6:org.apache.karaf.features.core:4.0.10]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1086)[6:org.apache.karaf.features.core:4.0.10]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748)[:1.8.0_222]

This occurs on three of our profiles, all involving the opencast-engage-ui bundle.  The odd part is that this appears in our 6.6 version, but *not* our 6.5 - but there's no part of the changeset between 6.5[1] and 6.6[2] which should be causing this.  We're using the servicemix bundle[3], which is the same across both of our 6.5 and 6.6 versions.  The bundle headers for 6.5 look like this:

>bundle:headers opencast-engage-ui

Opencast :: engage-ui (345)
---------------------------
Bnd-LastModified = 1560502504114
Build-Jdk = 1.8.0_212
Build-Number = 618eec6
Built-By = lars
Created-By = Apache Maven Bundle Plugin
Http-Alias = /engage/ui
Http-Classpath = /ui
Http-Welcome = index.html
Manifest-Version = 1.0
Tool = Bnd-3.5.0.201709291849

Bundle-Category = opencastproject
Bundle-Description = Opencast is a media capture, processing, management and distribution system
Bundle-DocURL = http://opencastproject.org/
Bundle-License = http://www.osedu.org/licenses/ECL-2.0/ecl2.txt
Bundle-ManifestVersion = 2
Bundle-Name = Opencast :: engage-ui
Bundle-SymbolicName = opencast-engage-ui
Bundle-Vendor = The Opencast Project
Bundle-Version = 6.5.0

But I'm not sure how to get the headers for 6.6 since the feature won't even start :(

Any clues about how to proceed here?

Thanks,
G

3: mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr339-api-2.0.1/2.6.0


--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist



--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist