Adding a run requirement to a bndrun file - "missing requirement"

102 views
Skip to first unread message

Dan Gravell

unread,
Sep 22, 2016, 8:39:24 AM9/22/16
to bndtools-users
Making progress in my 2.x to 3.2 migration. Next step: getting a bndrun file to work.

In my -runrequires :

osgi.identity;filter:='(&(osgi.identity=org.apache.felix.scr)(version>=1.6.0))',\

However clicking resolve gives:

org.osgi.service.resolver.ResolutionException: Unable to resolve <<INITIAL>> version=null: missing requirement org.apache.felix.scr; version=1.6.0

(I often see "<<INITIAL>>" btw, what does it mean?).


However I can't drag that into a bndrun file in the same way I can do into a bnd build path.

I don't want to download and host locally.

How to proceed?

Dan

Dan Gravell

unread,
Sep 22, 2016, 8:42:07 AM9/22/16
to bndtools-users
Here's my -runrepos:

-runrepos: Local,\
Bndtools Hub,\
Workspace

Although only "Local" and "Workspace" are checked at the top left of the "Repositories" panel in the bndrun GUI.

Dan

Dan Gravell

unread,
Sep 22, 2016, 8:48:27 AM9/22/16
to bndtools-users
Ah - I needed the "InfoRepositoryWrapper[1]" repository enabled.

Hope this helps someone else...

Dan Gravell

unread,
Sep 22, 2016, 8:53:29 AM9/22/16
to bndtools-users
Still another problem:

org.osgi.service.resolver.ResolutionException: Unable to resolve <<INITIAL>> version=null: missing requirement com.elsten.bliss.analytics 
->  Unable to resolve com.elsten.bliss.analytics version=1.0.1: missing requirement com.elsten.bliss.platform.model; version=[2.0.0,3.0.0) 
->  Unable to resolve com.elsten.bliss.model version=37.0.1: missing requirement com.elsten.apache.commons.httpclient; version=[1.0.0,2.0.0) 
->  Unable to resolve com.elsten.util version=6.12.0: missing requirement org.apache.commons.httpclient]]]

"org.apache.commons.httpclient" is in "com.elsten.util"'s build path, and it all compiles.

It is located in the "Central" repository: commons-httpclient__commons-httpclient;version='[3.1.0,4.0.0)'

Do I need to do something special to make sure the Central repo is used?

Dan

Raymond Auge

unread,
Sep 22, 2016, 10:07:44 AM9/22/16
to bndtool...@googlegroups.com
Don't you need to include "Central" in your -runrepos?

- Ray

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Raymond Augé (@rotty3000)
Senior Software Architect Liferay, Inc. (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance (@OSGiAlliance)

Dan Gravell

unread,
Sep 22, 2016, 12:13:01 PM9/22/16
to bndtools-users
Sorry, forgot to say I tried that, it didn't work, or didn't change the behaviour anyway.


On Thursday, September 22, 2016 at 3:07:44 PM UTC+1, Raymond Auge wrote:
Don't you need to include "Central" in your -runrepos?

- Ray
On Thu, Sep 22, 2016 at 8:53 AM, Dan Gravell <d...@elstensoftware.com> wrote:
Still another problem:

org.osgi.service.resolver.ResolutionException: Unable to resolve <<INITIAL>> version=null: missing requirement com.elsten.bliss.analytics 
->  Unable to resolve com.elsten.bliss.analytics version=1.0.1: missing requirement com.elsten.bliss.platform.model; version=[2.0.0,3.0.0) 
->  Unable to resolve com.elsten.bliss.model version=37.0.1: missing requirement com.elsten.apache.commons.httpclient; version=[1.0.0,2.0.0) 
->  Unable to resolve com.elsten.util version=6.12.0: missing requirement org.apache.commons.httpclient]]]

"org.apache.commons.httpclient" is in "com.elsten.util"'s build path, and it all compiles.

It is located in the "Central" repository: commons-httpclient__commons-httpclient;version='[3.1.0,4.0.0)'

Do I need to do something special to make sure the Central repo is used?

Dan

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Dan Gravell

unread,
Sep 26, 2016, 8:42:37 AM9/26/16
to bndtools-users
Any ideas on this anyone? I can't use bndtools 3.2 as is.

I can go to the com.elsten.util project (as above, the one at the bottom of the dependency chain until httpclient) and that resolves fine.

Dan Gravell

unread,
Sep 26, 2016, 8:56:57 AM9/26/16
to bndtools-users
Still happening in 3.3.

Dan Gravell

unread,
Sep 27, 2016, 8:49:25 AM9/27/16
to bndtools-users
I tried adding the bundle to "-runblacklist" not really fully understanding what that does (just doesn't try to add said bundles to -runbundles?) and it still doesn't work, for the same reason:

missing requirement org.apache.commons.httpclient

Neil Bartlett

unread,
Sep 27, 2016, 9:29:36 AM9/27/16
to bndtool...@googlegroups.com
Which bundle did you add to blacklist? This doesn’t sound like the solution though. Blacklist means “never use this bundle even if it’s in the repository and satisfies a requirement”.

The error message looks kind of odd. It doesn’t say what kind of requirement is failing… is it an import package or a require bundle? What do the dependencies of com.elsten.util look like?

Neil

Dan Gravell

unread,
Sep 27, 2016, 9:57:04 AM9/27/16
to bndtools-users
It's after clicking "Resolve" on run requirements. com.elsten.util has httpclient in its -buildpath and Import-Package declaration. I can resolve com.elsten.util fine.

Here's the bnd file for com.elsten.util:

Bundle-Version: 6.12.0
Export-Package:  \
com.elsten.collections;version=1.0.0,\
com.elsten.google.base;version=1.1.0,\
com.elsten.google.collections;version=1.1.0,\
com.elsten.lang;version=1.0.0,\
com.elsten.lucene;version=1.0.0,\
com.elsten.scala;version=1.0.0,\
com.elsten.sparql;version=1.0.0,\
com.elsten.osgi;version=1.0.0,\
com.elsten.apache.commons.httpclient;version=1.0.0,\
com.elsten.concurrent;version=1.0.0,\
com.elsten.jdbm;version=1.0.0,\
com.elsten.xml;version=1.0.0,\
com.elsten.util;version=1.4.0,\
com.elsten.mapdb,\
com.elsten.lang.management,\
com.elsten.apache.commons.lang
-buildpath: \
org.apache.commons.io;version=1.4.0,\
org.apache.commons.lang;version=2.6.0.v201404270220,\
log4j;version=1.2.17,\
com.google.guava;version=12.0.0,\
org.mapdb;version=1.0,\
commons-httpclient__commons-httpclient;version=3.1.0.rc1,\
org.scala-lang.scala-library;version=2.11.8


Agree about blacklist, I just wanted to see if maybe some other underlying error was exposed.

Dan

Neil Bartlett

unread,
Sep 27, 2016, 10:13:37 AM9/27/16
to bndtool...@googlegroups.com
I’m confused. There exists both org.apache.commons.httpclient AND com.elsten.apache.commons.httpclient. Are these packages or bundle symbolic names?

You say that you can resolve com.elsen.util fine, but in your original mail it was not resolving.

Dan Gravell

unread,
Sep 27, 2016, 10:24:02 AM9/27/16
to bndtools-users
com.elsten.apache.commons.httpclient is a package with some utilities for using httpclient.

Where did I say com.elsten.util was not resolving httpclient? It both compiles and resolves just fine. Let me know and I can clarify.

Neil Bartlett

unread,
Sep 27, 2016, 10:50:24 AM9/27/16
to bndtool...@googlegroups.com
On 27 Sep 2016, at 15:24, Dan Gravell <d...@elstensoftware.com> wrote:

com.elsten.apache.commons.httpclient is a package with some utilities for using httpclient.

Where did I say com.elsten.util was not resolving httpclient? It both compiles and resolves just fine. Let me know and I can clarify.

From your first email in this chain:

Dan Gravell

unread,
Sep 27, 2016, 11:47:05 AM9/27/16
to bndtools-users
Ok, sorry. What I meant was, I can click resolve inside com.elsten.util and it doesn't show errors.

However, it also doesn't appear to generate any -runbundles either! The "Resolution Results" dialog is just empty.

Dan Gravell

unread,
Sep 29, 2016, 11:44:25 AM9/29/16
to bndtools-users
Anyone know a way of upping the logging so I can see what resolve is doing?

There's nothing in the error logs, nor on stdout/err.

It feels like it's failing silently somewhere.

BJ Hargrave

unread,
Sep 29, 2016, 11:45:31 AM9/29/16
to bndtool...@googlegroups.com
Did you look at the source code to see how it logs?
--
BJ

Dan Gravell

unread,
Sep 29, 2016, 11:55:36 AM9/29/16
to bndtools-users
I was kind of assuming there would be an documentation page for it, but I guess I'm off to github then...

BJ Hargrave

unread,
Sep 29, 2016, 11:58:45 AM9/29/16
to bndtool...@googlegroups.com
The joy of open source! But once you figure out the answer, please do make a PR to improve the documentation for the next poor soul :-)

Dan Gravell

unread,
Sep 29, 2016, 12:01:50 PM9/29/16
to bndtools-users
To enroute? I can't see the bndtools website on github.

Dan Gravell

unread,
Sep 29, 2016, 12:03:17 PM9/29/16
to bndtools-users
Sorry, I see it now, I was expecting a different repo.

Dan Gravell

unread,
Sep 30, 2016, 10:17:27 AM9/30/16
to bndtools-users
I decided to just check the code out and run it in a runtime workspace or whatever the modern equivalent is.

I could only test the resolution of com.elsten.util which I thought would be best anyway as it's a smaller test case.

This is now showing the same message as the bndrun file resolution:

Unable to resolve <<INITIAL>> version=null: 
missing requirement com.elsten.util
->  Unable to resolve com.elsten.util version=6.12.0: missing requirement org.apache.commons.httpclient]]]

I traced it to the point that the org.apache.commons.httpclient is inspected to see if it can find its capabilities. But it returns no package wiring capabilities.

Sure enough if I look at this in the Resolution view is shows nothing.

Remember this is coming from "Central" (Maven Central I think?). But I thought jpm4j was supposed to wrap the bundle automatically, exposing its capabilities, or something like that? If not, what is the point of having Central?

And how come the bundle which depends on it compiles fine?

I guess I might have just fundamentally misunderstood the point of these repositories and how they are supposed to work.

Dan

BJ Hargrave

unread,
Sep 30, 2016, 10:36:23 AM9/30/16
to bndtool...@googlegroups.com
JPM is a indexing service. It does not host or modify jars. If org.apache.commons.httpclient from Apache is not a bundle, then it wouldn't/couldn't be indexed by JPM as a bundle. I searched JPM for org.apache.commons.httpclient and it returns bundles where people have packaged org.apache.commons.httpclient into a bundle with OSGi metadata.

Also, compilation with javac does not care about OSGi metadata. A jar is a jar and javac can see all the types in the jar. But at resolution-time, OSGi metadata matters.

Dan Gravell

unread,
Sep 30, 2016, 10:50:17 AM9/30/16
to bndtools-users
Sorry - you're right. I've been tripped up by the build time/resolve time difference before.

I can find the good old springsource wrappers, those should work.

I was finding it difficult to interpret the JPM pages. For example on http://repo.jpm4j.org/#!/p/sha/C493A925A091AC3D8F449D9265FE12482DABB2A7//0.0.0?tab=candr it would be good to have some headings for the columns. Not that you are responsible for those pages, just sayin'.

I think the left column are reqs, the right are capabilities (inlucing exported packages) and the middle... private or just packages contained therein.

That appears to work now :-)

Dan
Reply all
Reply to author
Forward
0 new messages