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 2017/06/13 17:40:13 UTC

org.ops4j.pax.url.wrap/2.5.2 missing org.slf4j package?

I'm trying to build a custom karaf distribution with the "karaf-assembly" maven packaging. 
I am making slow progress :-)

My latest issue comes about through trying to resolve lack of a javax.servlet package requirement. 
So I naively included the org.apache.felix:org.apache.felix.http.servlet-api bundle as a dependency of the feature I'm including in my assembly. This is what we normally use in development in bndtools, but we normally use apache felix HTTP rather than pax-web generally.

As soon as I do that I get an odd build failure:
Unable to resolve org.ops4j.pax.url.wrap/2.5.2: missing requirement [org.ops4j.pax.url.wrap/2.5.2] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.slf4j)(version>=1.6.0)(!(version>=2.0.0)))"]

If I remove org.apache.felix.http.servlet-api it builds, and I can run the resulting karaf. My karaf shell fu isn't that great, but feature:list shows me that "wrap" is "started", and
  bundle:info mvn:org.ops4j.pax.url/pax-url-wrap/2.5.2/jar/uber
shows me that it imports the org.slf4j package. I don't know how to find out where it resolves that from from the shell, but the web console shows me:

Imported Packages
org.slf4j,version=1.7.25 from org.ops4j.pax.logging.pax-logging-api (5)
org.slf4j,version=1.6.6 from org.ops4j.pax.logging.pax-logging-api (5)
org.slf4j,version=1.5.11 from org.ops4j.pax.logging.pax-logging-api (5)
org.slf4j,version=1.4.3 from org.ops4j.pax.logging.pax-logging-api (5)

So I don't understand why I'm suddenly getting a resolution failure for slf4j from pax.url.wrap.

I also don't understand why including org.apache.felix:org.apache.felix.http.servlet-api suddenly causes this, nothing in the manifest for it would appear to indicate a need for it. All it is is a simple bundle that contains and exports the javax.servlet api.

To sidestep the the question, how *should* I resolve the requirement for javax.servlet package? There doesn't seem to be a pax-web bundle that I can find that provides the javax.servlet package.

Thanks (again).

Re: org.ops4j.pax.url.wrap/2.5.2 missing org.slf4j package?

Posted by Achim Nierbeck <bc...@googlemail.com>.
Thank good for Karaf features, I don't actually have to "FIX" a bundle
(like re-invent the world a second time) [1]
I just need to make sure the feature declares a capability that a bundle
"should" have, though
I've to admit that those requirements added by bnd is actually more
hindering then helpful.

regards, Achim

[1] -
https://github.com/ops4j/org.ops4j.pax.web/commit/72935c741bf76fc2397253d3cba4f9a9b712cee8


2017-06-13 23:16 GMT+02:00 <to...@quarendon.net>:

> > the easiest would be to actually remove that "new" requirement for those
> > components.
> > A fix for this is on it's way for Pax Web, so you'll have something
> that'll
> > work for you.
>
> Sorry Achim, you'll need to spell that out. What is that you'd fix? Create
> a pax-web bundle that contains and exports the javax.servlet packages?
>
> Thanks in advance of the fix though.
>



-- 

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: org.ops4j.pax.url.wrap/2.5.2 missing org.slf4j package?

Posted by to...@quarendon.net.
> the easiest would be to actually remove that "new" requirement for those
> components.
> A fix for this is on it's way for Pax Web, so you'll have something that'll
> work for you.

Sorry Achim, you'll need to spell that out. What is that you'd fix? Create a pax-web bundle that contains and exports the javax.servlet packages?

Thanks in advance of the fix though.

Re: org.ops4j.pax.url.wrap/2.5.2 missing org.slf4j package?

Posted by Achim Nierbeck <bc...@googlemail.com>.
Tom,

the easiest would be to actually remove that "new" requirement for those
components.
A fix for this is on it's way for Pax Web, so you'll have something that'll
work for you.

regards, Achim


2017-06-13 19:40 GMT+02:00 <to...@quarendon.net>:

>
> I'm trying to build a custom karaf distribution with the "karaf-assembly"
> maven packaging.
> I am making slow progress :-)
>
> My latest issue comes about through trying to resolve lack of a
> javax.servlet package requirement.
> So I naively included the org.apache.felix:org.apache.felix.http.servlet-api
> bundle as a dependency of the feature I'm including in my assembly. This is
> what we normally use in development in bndtools, but we normally use apache
> felix HTTP rather than pax-web generally.
>
> As soon as I do that I get an odd build failure:
> Unable to resolve org.ops4j.pax.url.wrap/2.5.2: missing requirement
> [org.ops4j.pax.url.wrap/2.5.2] osgi.wiring.package; filter:="(&(osgi.wiring.
> package=org.slf4j)(version>=1.6.0)(!(version>=2.0.0)))"]
>
> If I remove org.apache.felix.http.servlet-api it builds, and I can run
> the resulting karaf. My karaf shell fu isn't that great, but feature:list
> shows me that "wrap" is "started", and
>   bundle:info mvn:org.ops4j.pax.url/pax-url-wrap/2.5.2/jar/uber
> shows me that it imports the org.slf4j package. I don't know how to find
> out where it resolves that from from the shell, but the web console shows
> me:
>
> Imported Packages
> org.slf4j,version=1.7.25 from org.ops4j.pax.logging.pax-logging-api (5)
> org.slf4j,version=1.6.6 from org.ops4j.pax.logging.pax-logging-api (5)
> org.slf4j,version=1.5.11 from org.ops4j.pax.logging.pax-logging-api (5)
> org.slf4j,version=1.4.3 from org.ops4j.pax.logging.pax-logging-api (5)
>
> So I don't understand why I'm suddenly getting a resolution failure for
> slf4j from pax.url.wrap.
>
> I also don't understand why including org.apache.felix:org.apache.felix.http.servlet-api
> suddenly causes this, nothing in the manifest for it would appear to
> indicate a need for it. All it is is a simple bundle that contains and
> exports the javax.servlet api.
>
> To sidestep the the question, how *should* I resolve the requirement for
> javax.servlet package? There doesn't seem to be a pax-web bundle that I can
> find that provides the javax.servlet package.
>
> Thanks (again).
>



-- 

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