You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by to...@quarendon.net on 2016/09/20 11:45:22 UTC

How do I resolve resolution problems in Karaf

I'm really struggling to get my bundles installed in Karaf, so I'd appreciate
some hints on how to diagnose some issues. I'm trying to do a feature:install of
a features.xml file I've written to install my bundles. 
My latest is:

missing requirement osgi.wiring.package;
filter:="(&(osgi.wiring.package=osgi.enroute.dto.api)(version>=1.0.0)(!(version>=2.0.0)))"
[caused by: Unable to resolve osgi.enroute.base.api [62](R 62.0): missing
requirement [osgi.enroute.base.api [62](R 62.0)] osgi.unresolvable;
(&(must.not.resolve=*)(!(must.not.resolve=*)))]]]

My interpretation of this is that I've got conflicting versions of something. I
have no idea what, nor to figure out what the cause is.

Up to now I've always just been using bndtools in eclipse (and the bundles I'm
installing all work fine there), my first experience of Karaf was yesterday, so
beyond what I've read in the docs, I know nothing about what useful commands
there might be to help me diagnose. I don't even know how I would list what I've
currently got installed that might satisfy osgi.enroute.dto.api or
osgi.enroute.base.api.

Any hints would be much appreciated.
This seems to be extraordinarily more complicated that "resolve" in bndtools, or
am I being naive?

Thanks.

Re: How do I resolve resolution problems in Karaf

Posted by Guillaume Nodet <gn...@apache.org>.
I'm not sure exactly how the "resolve" in bndtools work, but in Karaf, the
resolution
is done on all constraints, including generic capabilities / requirements,
and
including osgi services.

In this very case, you have a bundle that requires the osgi.unresolvable
capability.
Why did you add this requirement on your bundle ?
Try removing it from your bundle manifest.
Also, I'm not sure how that would work in the OSGi framework, as the OSGi
framework
also resolve generic capabilities and requirements.  The only different is
those
flagged with effective:="active" which are ignored by the framework
resolver.
There are some flags in Karaf to disable them too if needed.

Guillaume


2016-09-20 13:45 GMT+02:00 <to...@quarendon.net>:

> I'm really struggling to get my bundles installed in Karaf, so I'd
> appreciate
> some hints on how to diagnose some issues. I'm trying to do a
> feature:install of
> a features.xml file I've written to install my bundles.
> My latest is:
>
> missing requirement osgi.wiring.package;
> filter:="(&(osgi.wiring.package=osgi.enroute.dto.api)(
> version>=1.0.0)(!(version>=2.0.0)))"
> [caused by: Unable to resolve osgi.enroute.base.api [62](R 62.0): missing
> requirement [osgi.enroute.base.api [62](R 62.0)] osgi.unresolvable;
> (&(must.not.resolve=*)(!(must.not.resolve=*)))]]]
>
> My interpretation of this is that I've got conflicting versions of
> something. I
> have no idea what, nor to figure out what the cause is.
>
> Up to now I've always just been using bndtools in eclipse (and the bundles
> I'm
> installing all work fine there), my first experience of Karaf was
> yesterday, so
> beyond what I've read in the docs, I know nothing about what useful
> commands
> there might be to help me diagnose. I don't even know how I would list
> what I've
> currently got installed that might satisfy osgi.enroute.dto.api or
> osgi.enroute.base.api.
>
> Any hints would be much appreciated.
> This seems to be extraordinarily more complicated that "resolve" in
> bndtools, or
> am I being naive?
>
> Thanks.
>



-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Re: How do I resolve resolution problems in Karaf

Posted by Benson Margulies <be...@basistech.com>.
Tom, if you drop them _as bundles_, karaf works like any other osgi
container -- you have to drop in all the bundles you need. You might
need to set serviceRequirements to disable in
org.apache.karaf.features.cfg if your bundle manifests are not fully
informative on the topic of service capabilities.

If you drop them _as features_, you need to make correct features, and
that's painful if you can't get help from tooling.

On Tue, Sep 20, 2016 at 8:22 AM,  <to...@quarendon.net> wrote:
> OK, that's really useful, I'll follow some of that up.
>
> As usual I went into this with the naive assumption that since Karaf was an OSGi
> container, I would just be able to drop my bundles in and it would all just
> work. Sadly things aren't quite as simple.
>
>> On 20 September 2016 at 13:19 David Daniel <da...@gmail.com>
>> wrote:
>>
>>
>> Tom integrating karaf development and bndtools development has been tricky
>> but it is getting better.  Karaf development is centered around Mavens
>> build process while bndtools is centered around a custom workspace in cnf.
>> This release bndtools will be supporting maven and you can see the latest
>> post here https://groups.google.com/forum/#!topic/bndtools-users/VcQ2rsb--Pk
>> You can see how to include karaf features in a bndrun file in Christians
>> examples here https://github.com/cschneider/osgi-chat and the new cxf
>> example.  What I do in my build is I include a features.bnd file where I
>> map karaf features to bndrun runrequires/runbundles statements and I
>> include that in my bndrun files.  I have to separately maintain my
>> features.bnd and my features.xml.  I do this so I can build both a single
>> jar deployable and run in karaf and pax-exam.  Although the mixing of the
>> two build processes is hard it is becoming easier by the day.
>>
>> On Tue, Sep 20, 2016 at 7:45 AM, <to...@quarendon.net> wrote:
>>
>> > I'm really struggling to get my bundles installed in Karaf, so I'd
>> > appreciate
>> > some hints on how to diagnose some issues. I'm trying to do a
>> > feature:install of
>> > a features.xml file I've written to install my bundles.
>> > My latest is:
>> >
>> > missing requirement osgi.wiring.package;
>> > filter:="(&(osgi.wiring.package=osgi.enroute.dto.api)(
>> > version>=1.0.0)(!(version>=2.0.0)))"
>> > [caused by: Unable to resolve osgi.enroute.base.api [62](R 62.0): missing
>> > requirement [osgi.enroute.base.api [62](R 62.0)] osgi.unresolvable;
>> > (&(must.not.resolve=*)(!(must.not.resolve=*)))]]]
>> >
>> > My interpretation of this is that I've got conflicting versions of
>> > something. I
>> > have no idea what, nor to figure out what the cause is.
>> >
>> > Up to now I've always just been using bndtools in eclipse (and the bundles
>> > I'm
>> > installing all work fine there), my first experience of Karaf was
>> > yesterday, so
>> > beyond what I've read in the docs, I know nothing about what useful
>> > commands
>> > there might be to help me diagnose. I don't even know how I would list
>> > what I've
>> > currently got installed that might satisfy osgi.enroute.dto.api or
>> > osgi.enroute.base.api.
>> >
>> > Any hints would be much appreciated.
>> > This seems to be extraordinarily more complicated that "resolve" in
>> > bndtools, or
>> > am I being naive?
>> >
>> > Thanks.
>> >

Re: How do I resolve resolution problems in Karaf

Posted by to...@quarendon.net.
OK, that's really useful, I'll follow some of that up.

As usual I went into this with the naive assumption that since Karaf was an OSGi
container, I would just be able to drop my bundles in and it would all just
work. Sadly things aren't quite as simple.

> On 20 September 2016 at 13:19 David Daniel <da...@gmail.com>
> wrote:
> 
> 
> Tom integrating karaf development and bndtools development has been tricky
> but it is getting better.  Karaf development is centered around Mavens
> build process while bndtools is centered around a custom workspace in cnf.
> This release bndtools will be supporting maven and you can see the latest
> post here https://groups.google.com/forum/#!topic/bndtools-users/VcQ2rsb--Pk
> You can see how to include karaf features in a bndrun file in Christians
> examples here https://github.com/cschneider/osgi-chat and the new cxf
> example.  What I do in my build is I include a features.bnd file where I
> map karaf features to bndrun runrequires/runbundles statements and I
> include that in my bndrun files.  I have to separately maintain my
> features.bnd and my features.xml.  I do this so I can build both a single
> jar deployable and run in karaf and pax-exam.  Although the mixing of the
> two build processes is hard it is becoming easier by the day.
> 
> On Tue, Sep 20, 2016 at 7:45 AM, <to...@quarendon.net> wrote:
> 
> > I'm really struggling to get my bundles installed in Karaf, so I'd
> > appreciate
> > some hints on how to diagnose some issues. I'm trying to do a
> > feature:install of
> > a features.xml file I've written to install my bundles.
> > My latest is:
> >
> > missing requirement osgi.wiring.package;
> > filter:="(&(osgi.wiring.package=osgi.enroute.dto.api)(
> > version>=1.0.0)(!(version>=2.0.0)))"
> > [caused by: Unable to resolve osgi.enroute.base.api [62](R 62.0): missing
> > requirement [osgi.enroute.base.api [62](R 62.0)] osgi.unresolvable;
> > (&(must.not.resolve=*)(!(must.not.resolve=*)))]]]
> >
> > My interpretation of this is that I've got conflicting versions of
> > something. I
> > have no idea what, nor to figure out what the cause is.
> >
> > Up to now I've always just been using bndtools in eclipse (and the bundles
> > I'm
> > installing all work fine there), my first experience of Karaf was
> > yesterday, so
> > beyond what I've read in the docs, I know nothing about what useful
> > commands
> > there might be to help me diagnose. I don't even know how I would list
> > what I've
> > currently got installed that might satisfy osgi.enroute.dto.api or
> > osgi.enroute.base.api.
> >
> > Any hints would be much appreciated.
> > This seems to be extraordinarily more complicated that "resolve" in
> > bndtools, or
> > am I being naive?
> >
> > Thanks.
> >

Re: How do I resolve resolution problems in Karaf

Posted by David Daniel <da...@gmail.com>.
Tom integrating karaf development and bndtools development has been tricky
but it is getting better.  Karaf development is centered around Mavens
build process while bndtools is centered around a custom workspace in cnf.
This release bndtools will be supporting maven and you can see the latest
post here https://groups.google.com/forum/#!topic/bndtools-users/VcQ2rsb--Pk
You can see how to include karaf features in a bndrun file in Christians
examples here https://github.com/cschneider/osgi-chat and the new cxf
example.  What I do in my build is I include a features.bnd file where I
map karaf features to bndrun runrequires/runbundles statements and I
include that in my bndrun files.  I have to separately maintain my
features.bnd and my features.xml.  I do this so I can build both a single
jar deployable and run in karaf and pax-exam.  Although the mixing of the
two build processes is hard it is becoming easier by the day.

On Tue, Sep 20, 2016 at 7:45 AM, <to...@quarendon.net> wrote:

> I'm really struggling to get my bundles installed in Karaf, so I'd
> appreciate
> some hints on how to diagnose some issues. I'm trying to do a
> feature:install of
> a features.xml file I've written to install my bundles.
> My latest is:
>
> missing requirement osgi.wiring.package;
> filter:="(&(osgi.wiring.package=osgi.enroute.dto.api)(
> version>=1.0.0)(!(version>=2.0.0)))"
> [caused by: Unable to resolve osgi.enroute.base.api [62](R 62.0): missing
> requirement [osgi.enroute.base.api [62](R 62.0)] osgi.unresolvable;
> (&(must.not.resolve=*)(!(must.not.resolve=*)))]]]
>
> My interpretation of this is that I've got conflicting versions of
> something. I
> have no idea what, nor to figure out what the cause is.
>
> Up to now I've always just been using bndtools in eclipse (and the bundles
> I'm
> installing all work fine there), my first experience of Karaf was
> yesterday, so
> beyond what I've read in the docs, I know nothing about what useful
> commands
> there might be to help me diagnose. I don't even know how I would list
> what I've
> currently got installed that might satisfy osgi.enroute.dto.api or
> osgi.enroute.base.api.
>
> Any hints would be much appreciated.
> This seems to be extraordinarily more complicated that "resolve" in
> bndtools, or
> am I being naive?
>
> Thanks.
>

Re: How do I resolve resolution problems in Karaf

Posted by Christian Schneider <ch...@die-schneider.net>.
The problem is that your example needs an implementation of the dto 
support but you installed the api bundle instead which is not suitable 
for runtime.

On 20.09.2016 13:45, tom@quarendon.net wrote:
> I'm really struggling to get my bundles installed in Karaf, so I'd appreciate
> some hints on how to diagnose some issues. I'm trying to do a feature:install of
> a features.xml file I've written to install my bundles.
> My latest is:
>
> missing requirement osgi.wiring.package;
> filter:="(&(osgi.wiring.package=osgi.enroute.dto.api)(version>=1.0.0)(!(version>=2.0.0)))"
> [caused by: Unable to resolve osgi.enroute.base.api [62](R 62.0): missing
> requirement [osgi.enroute.base.api [62](R 62.0)] osgi.unresolvable;
> (&(must.not.resolve=*)(!(must.not.resolve=*)))]]]
The last part (&(must.not.resolve=*)(!(must.not.resolve=*)) is a special 
trick the new api bundles use to make sure they can not be installed. 
You should only use the base api at compile time. For deployment use the 
bundle with the dto implementation. I am not sure which bundle this is 
but the enroute experts can tell you this.
Btw. The same is true for the OSGi spec bundles (core, compendium and 
enterprise).

Christian
> My interpretation of this is that I've got conflicting versions of something. I
> have no idea what, nor to figure out what the cause is.
>
> Up to now I've always just been using bndtools in eclipse (and the bundles I'm
> installing all work fine there), my first experience of Karaf was yesterday, so
> beyond what I've read in the docs, I know nothing about what useful commands
> there might be to help me diagnose. I don't even know how I would list what I've
> currently got installed that might satisfy osgi.enroute.dto.api or
> osgi.enroute.base.api.
>
> Any hints would be much appreciated.
> This seems to be extraordinarily more complicated that "resolve" in bndtools, or
> am I being naive?
>
> Thanks.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com