How to run bundles which require javax.crypto

265 views
Skip to first unread message

Frank Kusters

unread,
Oct 8, 2014, 10:08:31 AM10/8/14
to bndtool...@googlegroups.com
Hi,

I'm trying to use Eclipse Kura bundles from within Bndtools. To do so, I:

1. downloaded the "Raspberry jars" from the bottom of this page: https://www.eclipse.org/kura/downloads.php
2. added them to a local repository in Bndtools (at this point, I can add them to a build path in bnd.bnd)
3. created a run descriptor
4. added 'org.eclipse.kura.core.crypto' to the Run Requirements
5. pressed Resolve, and *kapoof* it tells me that javax.crypto cannot be resolved.

This seems logical, as javax.crypto is imported, but there is no package that exports it. It should somehow exist in the VM jar files.

Googling the problems turns up an unanswered StackOverflow question:

and a non-OSGi solution:

Any suggestions?

Regards,
Frank Kusters

Paul Bakker

unread,
Oct 8, 2014, 10:16:43 AM10/8/14
to bndtool...@googlegroups.com
Hi Frank,

I don't have experience with the javax.crypto packages, but in general you can use -runsystempackages to export extra packages provided by the JRE. So in this case:

-runsystempackages: javax.crypto

Hope that helpse :-)

Cheers,

Paul

--
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.

Frank Kusters

unread,
Oct 8, 2014, 10:36:24 AM10/8/14
to bndtool...@googlegroups.com, paul....@luminis.eu
Hello Paul,

Thanks for the advice. What would that look like when I'm using third party libraries? Should I create a faux 'javax' bundle, that exports the necessary packages?

Regards,
Frank

Op woensdag 8 oktober 2014 16:16:43 UTC+2 schreef Paul Bakker:

Paul Bakker

unread,
Oct 8, 2014, 11:00:12 AM10/8/14
to bndtool...@googlegroups.com
No, just add the -runsystempackages as I described to your run configuration and you're all set :-)

Angelo vd Sijpt

unread,
Oct 9, 2014, 1:46:46 AM10/9/14
to bndtool...@googlegroups.com
For the record: all packages in the java.* space can alway be accessed, and the framework always has a list of default package exports, containing a lot of javax.* packages. This list is determined by the execution environment, and usually maps rather close to a given Java version.

With the BND property that Paul described, you add your package to the org.osgi.framework.system.packages.extra framework property, and so have them exported _by the frameworks_; hence, no need to create a faux bundle.

Angelo
Reply all
Reply to author
Forward
0 new messages