You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Remy Masson <re...@ullink.com> on 2011/06/13 12:37:40 UTC

Missing import packages in the bundle manifest - failing iPOJO instantiations at runtime

Hi,

I'm encountering an issue when using both iPOJO and BND.

I'm using BND to figure which packages should be required by the bundle.
BND, when inspecting the class' bytecode, won't consider annotations having
retention policies other than RUNTIME, which is the case of @Provides. This
seems to make sense - if they're not available at run time, there is no
reason to be requiring them.
However if the package of the interface isn't imported by the extension,
iPOJO will fail instancing the POJO since it wasn't required by the
extension.

The reason the interface isn't used anywhere else is that the class itself
extends an abstract class which is not provided by the bundle - BND is not
supposed to be importing other than by inspecting the annotation.

Am I doing something wrong?
The way I see it, either:
- the iPOJO task should be adding the required packages in the
Import-package clause
- the Provides annotation could have a runtime retention policy in order for
BND (or other bytecode inspecting tool) to be able to know it has to
consider the classes it specifies
- I could inspect the manifest and look for the iPojo specifications, and
add the corresponding packages if they're not already there

The first option seems to be the most sensible one, but I'm not sure. Did I
miss something?

Thanks for your input,

Regards,
Rémy