Strange resolution problem

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

Strange resolution problem

dleangen

Hi!

I am stumped. I am having a resolution issue in Karaf as follows:


org.osgi.framework.BundleException: Unable to resolve net.leangen.expedition.platform.ddd.diag [101](R 101.0): missing requirement [net.leangen.expedition.platform.ddd.diag [101](R 101.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.serializer)(version>=1.0.0)(!(version>=2.0.0))) Unresolved requirements: [[net.leangen.expedition.platform.ddd.diag [101](R 101.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.serializer)(version>=1.0.0)(!(version>=2.0.0)))]


The problem is that there **is no package** org.osgi.service.serializer. There is only org.apache.felix.serializer.

I have gone through all my OBRs and repositories, but cannot find any reference to that package. I even did a search in the Karaf code and did not find any such reference. Since the package does not exist, the resolution error is correct. The problem is: why is there a requirement on that package in the first place??


What am I missing??


Thanks!
=David


Reply | Threaded
Open this post in threaded view
|

Re: Strange resolution problem

Achim Nierbeck
Hi, 

looks like you do have an import for it in your bundle. So somewhere in your bytecode there seems to be an import for it. 
Maybe you've used a newer version while building, compared to what you've got when running. 

regards, Achim 

2017-10-09 8:42 GMT+02:00 David Leangen <[hidden email]>:

Hi!

I am stumped. I am having a resolution issue in Karaf as follows:


org.osgi.framework.BundleException: Unable to resolve net.leangen.expedition.platform.ddd.diag [101](R 101.0): missing requirement [net.leangen.expedition.platform.ddd.diag [101](R 101.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.serializer)(version>=1.0.0)(!(version>=2.0.0))) Unresolved requirements: [[net.leangen.expedition.platform.ddd.diag [101](R 101.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.serializer)(version>=1.0.0)(!(version>=2.0.0)))]


The problem is that there **is no package** org.osgi.service.serializer. There is only org.apache.felix.serializer.

I have gone through all my OBRs and repositories, but cannot find any reference to that package. I even did a search in the Karaf code and did not find any such reference. Since the package does not exist, the resolution error is correct. The problem is: why is there a requirement on that package in the first place??


What am I missing??


Thanks!
=David





--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: Strange resolution problem

Guillaume Nodet-2
In reply to this post by dleangen
It was until a few months ago: 

So maybe your maven dependencies point to an old artifact ?

2017-10-09 8:42 GMT+02:00 David Leangen <[hidden email]>:

Hi!

I am stumped. I am having a resolution issue in Karaf as follows:


org.osgi.framework.BundleException: Unable to resolve net.leangen.expedition.platform.ddd.diag [101](R 101.0): missing requirement [net.leangen.expedition.platform.ddd.diag [101](R 101.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.serializer)(version>=1.0.0)(!(version>=2.0.0))) Unresolved requirements: [[net.leangen.expedition.platform.ddd.diag [101](R 101.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.serializer)(version>=1.0.0)(!(version>=2.0.0)))]


The problem is that there **is no package** org.osgi.service.serializer. There is only org.apache.felix.serializer.

I have gone through all my OBRs and repositories, but cannot find any reference to that package. I even did a search in the Karaf code and did not find any such reference. Since the package does not exist, the resolution error is correct. The problem is: why is there a requirement on that package in the first place??


What am I missing??


Thanks!
=David





--
------------------------
Guillaume Nodet

Reply | Threaded
Open this post in threaded view
|

Re: Strange resolution problem

dleangen


> On Oct 9, 2017, at 4:23 PM, Achim Nierbeck <[hidden email]> wrote:

> On Oct 9, 2017, at 4:28 PM, Guillaume Nodet <[hidden email]> wrote:

Thanks for the suggestions. You are no doubt right, so I quadruple checked my code, and bumped all versions. Ran the build locally, and confirmed that the old package is not being pulled in… but it still gets pulled in during resolution in Karaf.

Two questions:

1. Is there a mechanism to trace back the results of the resolution so I can try to pinpoint where the bad package is being pulled in?

2. Is it possible to blacklist in Karaf, so I can avoid a particular version of a bundle or package? (I did not see anything in the docs.)


Thanks!
=David


Reply | Threaded
Open this post in threaded view
|

Re: Strange resolution problem

Guillaume Nodet-2
Given it happens at runtime, then it means the import is already in your net.leangen.expedition.platform.ddd.diag bundle, so it's just the consequence of a problem happening at build time.  And this means, either a class import the package, or there is an explicit instruction to import it either in the bundle plugin config or in a bnd file.  Last possibility is that the bundle being built embeds code from a different jar, and that code has a class which import the package.
As for blacklisting, you can urls in the etc/blacklisted.properties file, but it seems the problem comes from your own net.leangen.expedition.platform.ddd.diag bundle...

2017-10-10 0:03 GMT+02:00 David Leangen <[hidden email]>:


> On Oct 9, 2017, at 4:23 PM, Achim Nierbeck <[hidden email]> wrote:

> On Oct 9, 2017, at 4:28 PM, Guillaume Nodet <[hidden email]> wrote:

Thanks for the suggestions. You are no doubt right, so I quadruple checked my code, and bumped all versions. Ran the build locally, and confirmed that the old package is not being pulled in… but it still gets pulled in during resolution in Karaf.

Two questions:

1. Is there a mechanism to trace back the results of the resolution so I can try to pinpoint where the bad package is being pulled in?

2. Is it possible to blacklist in Karaf, so I can avoid a particular version of a bundle or package? (I did not see anything in the docs.)


Thanks!
=David





--
------------------------
Guillaume Nodet

Reply | Threaded
Open this post in threaded view
|

Re: Strange resolution problem

dleangen

On Oct 10, 2017, at 3:31 PM, Guillaume Nodet <[hidden email]> wrote:

Given it happens at runtime, then it means the import is already in your net.leangen.expedition.platform.ddd.diag bundle, so it's just the consequence of a problem happening at build time.

Thanks Guillaume et al, much appreciated. Was finally able to track down and fix the problem. :-)

Turned out to be a versioning problem, which I only discovered after having bumped all the versions.


Cheers,
=David