Using existing plug in project created from library in OSGi bundle for Kura

183 views Asked by At

I am creating an OSGi bundle that will be executed under Kura (Target Platform: Kura Target Platform Equinox 3.8.1), on Raspberry Pi 2 model B.

The program should read data received on XBee and we want to use a library: https://github.com/andrewrapp/xbee-api

I created a new plugin project under Eclipse, "Plug-in from existing JAR archive" from the JAR files from the site above.

I tried to set the new plug in as "Required Plug-ins" in the MANIFEST.FM → Dependencies of my project, but that didn't work (java.lang.ClassNotFoundException)

I tried setting up a new folder in my project containing the library, but it is not working.

A similar question was asked, but I don't understand the answers because they are not detailed enough (Using an external java library in OSGI bundle).

2

There are 2 answers

0
David Woodard On BEST ANSWER

If you are only using the XBee API inside of your bundle, you would probably be ok just embedding the Jar file in your bundle. I think this process is pretty well outlined here.

2
Christian Schneider On

Instead of making a non-OSGi JAR file OSGi-ready or embedding it, I propose to look for an OSGi ready ZigBee bundle.

I would start with the zigbee4OSGi project. If this does not work well, then there is also a bundle from prosyst, but it does not seem to be free.

I found a ZigBee binding at openhab. This might help you to set up your project. I think they are using the same library you look for.