You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by David Leangen <ap...@leangen.net> on 2017/10/09 06:42:08 UTC

Strange resolution problem

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



Re: Strange resolution problem

Posted by Achim Nierbeck <bc...@googlemail.com>.
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 <ap...@leangen.net>:

>
> 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

Re: Strange resolution problem

Posted by David Leangen <ap...@leangen.net>.
> On Oct 10, 2017, at 3:31 PM, Guillaume Nodet <gn...@apache.org> 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



Re: Strange resolution problem

Posted by Guillaume Nodet <gn...@apache.org>.
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 <ap...@leangen.net>:

>
>
> > On Oct 9, 2017, at 4:23 PM, Achim Nierbeck <bc...@googlemail.com>
> wrote:
>
> > On Oct 9, 2017, at 4:28 PM, Guillaume Nodet <gn...@apache.org> 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

Re: Strange resolution problem

Posted by David Leangen <ap...@leangen.net>.

> On Oct 9, 2017, at 4:23 PM, Achim Nierbeck <bc...@googlemail.com> wrote:

> On Oct 9, 2017, at 4:28 PM, Guillaume Nodet <gn...@apache.org> 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



Re: Strange resolution problem

Posted by Guillaume Nodet <gn...@apache.org>.
It was until a few months ago:

https://github.com/apache/felix/commit/b71956b2e880d64780708506f048eeb0e48657d0#diff-d05f486393d3040f98547983cf7d6452

So maybe your maven dependencies point to an old artifact ?

2017-10-09 8:42 GMT+02:00 David Leangen <ap...@leangen.net>:

>
> 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