Bnd service components & Manifest generation

35 views
Skip to first unread message

Simon Chemouil

unread,
Feb 7, 2011, 10:29:45 AM2/7/11
to bndtools-users
Hi again! (I'm running for the Bnd harassment award ;-))

I'm using "Service-Component: *" in a project where some classes are
annotated with @Component. Bnd finds them and generates their XML
definition fine.

However, when a component has one or more service references, Bnd
generates the Service-Component manifest header with
component1Name.xml;bindMethodName/
bindMethod=serviceName(target);....,component2Name.xml... etc. This
matches with the Bnd format for defining components in the bnd file.

In any case, this ends up in the manifest generated with Bnd, and the
DS implementation in Equinox chokes on it because it's splitting the
paths to component definitions with a comma (',') and looks for a file
named component.xml;ref/bind="org.osgi.framework.log.LogService".

I checked the Compendium specification and what it states about the
Service-Component header (112.4). The syntax with references is not
explicitly supported, but there may be a higher spec I'm not aware of
that states that everything after a semi-colon is a property and ought
to be ignored if unknown? What would be the purpose of having those
references in the manifest?

So, should the bug be reported to Bnd or to Equinox DS? :-)

Kind regards,

Simon


BJ Hargrave

unread,
Feb 7, 2011, 10:42:47 AM2/7/11
to bndtool...@googlegroups.com
Looks like an Equinox DS bug.

The header production allows for directives and attributes and the DS spec states: "The Service-Component header has no architected directives or properties." (properties should be attributes.).
--

BJ

Simon Chemouil

unread,
Feb 7, 2011, 10:51:48 AM2/7/11
to bndtools-users
Hi,

Thanks for the quick reply. I saw that line but I was not quite sure
what it meant :).

I already have looked at a patch for Equinox DS, it's a lot more
practical for me than fixing Bnd (which would mean forking the maven-
bundle-plugin for now). I'll report the bug and propose the fix later
this week.

Thanks again,

Simon

Peter Kriens

unread,
Feb 7, 2011, 11:40:32 AM2/7/11
to bndtool...@googlegroups.com
Is it possible you're using a (really) old version? I think this was a bug in bnd and is removed in the latest version.

Kind regards,

Peter Kriens

Simon Chemouil

unread,
Feb 7, 2011, 11:49:52 AM2/7/11
to bndtools-users
Hi,

I'm using Bnd 1.15.0 with maven-bundle-plugin, and it's been updated
about 2 weeks ago. I know there are more recent versions of Bnd, but
for some reason this was the one used in 2.2.0 (before its release, I
was rolling my own maven plugin pointing to a more recent version, but
I preferred to switch back to the official version of the bundle
plugin).

So, if I understand correctly, this is a bug in Equinox DS *and* in
Bnd? Because Equinox DS shouldn't complain, and because Bnd writes
useless stuff in the manifest? :-) (I'd like to know if I should
submit the bugreport/patch to Equinox DS).

In the mean time, should I open a new issue at Felix's issue tracker
to ask for another update of the Bnd version in 2.4.0? (In fact I
know of another bug with Bnd's Maven integration that I planned to
discuss on the Felix ML but had no time yet that would be interesting
to solve. Class query macros don't work at all).

Simon

BJ Hargrave

unread,
Feb 7, 2011, 11:51:18 AM2/7/11
to bndtool...@googlegroups.com
You should still submit the Equinox DS bug report.
--

BJ

Peter Kriens

unread,
Feb 7, 2011, 12:48:33 PM2/7/11
to bndtool...@googlegroups.com
Well, Equinox should not complain. It is not a bug-big in bnd, it is just not necessary to add that extra info. Lets call it manifest hygiene :-)

Can you show me a class that has this problem? I am trying here and the manifest is perfectly clean whatever I try ...

Kind regards,

Peter Kriens

Simon Chemouil

unread,
Feb 8, 2011, 6:12:24 AM2/8/11
to bndtools-users
Hi Peter,

Have you tried a class with references?
I'm using annotations (@Component) to declare the service, and
<Service-Component>*</Service-Component> in my POM.

I don't a simple class handy that demonstrates this, but I'll try to
find some time to make a demo with the corresponding POM shortly.

Regards,

Simon

Peter Kriens

unread,
Feb 9, 2011, 4:57:28 AM2/9/11
to bndtool...@googlegroups.com
That is what I tried in bndtools and it is squeeky clean ...

Sure you're runing a late version of bnd? bnd puts its version in the manifest.

Kind regards,

Peter Kriens

Simon Chemouil

unread,
Feb 9, 2011, 5:23:54 AM2/9/11
to bndtools-users
On Feb 9, 10:57 am, Peter Kriens <peter.kri...@aqute.biz> wrote:
> That is what I tried in bndtools and it is squeeky clean ...
>
> Sure you're runing a late version of bnd? bnd puts its version in the manifest.

Yes, sure, bnd 1.15.0 with maven-bundle-plugin 2.2.0. The proper bnd
version is indeed written in the generated manifest.

Maybe the bug was fixed since 1.15.0, or maybe there's something wrong
with the way the maven-bundle-plugin configures bnd. I don't know if
we should move this discussion to the Felix ML...

I'll try to send a demo later today.

Simon

Peter Kriens

unread,
Feb 9, 2011, 5:29:44 AM2/9/11
to bndtool...@googlegroups.com
If you can demo it, send it to me and I check it out.

Kind regards,

Peter Kriens

Simon Chemouil

unread,
Feb 22, 2011, 8:17:15 AM2/22/11
to bndtools-users
Hi,

Small update. I have reported the bug to Equinox DS (late):
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337819

And, I'm not sure you got the demo Peter, but I sent it two weeks ago.
I wrote it from another address, so it might have ended up in your
spam filter.

Simon
Reply all
Reply to author
Forward
0 new messages