Your bundle needs to import the PubNub API package which means some other bundle must export the package. So you need to find or make a bundle which exports the PubNub API.
Note: The PubNub code may not work properly in an OSGi environment if it make certain assumptions about the class loading environment. So you may need knowledge of how the PubNub code works to properly make a bundle for it since you may need to write some small amount of code or properly craft the bundle manifest.
Good luck!
--
BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
----- Original message -----
From: Alessandro Verga via osgi-dev <osgi-dev@mail.osgi.org>
Sent by: osgi-dev-boun...@mail.osgi.org
To: osgi-dev@mail.osgi.org
Cc:
Subject: [EXTERNAL] [osgi-dev] Problem during bundle release: unresolved requirement
Date: Tue, Mar 31, 2020 10:23
Good evening,i am developing a bundle for Eclipse Smarthome (a binding for the OpenHAB runtime to be precise) but i have encountered a problem during the release of the bundle.i have already googled and mailed OpenHAB days ago, but i haven't find an answer.i have imported a non-OSGi library ( PubNub, a realtime database with functions of publish/subscribe ) through both a line in my pom.xml and feature.xml files.the bundle builds and compiles correctly (through running 'maven clean install').I would like to point out this is not a library problem, as i am using the same library, with the same dependencies, in another local java project, and it is working.The problem seems to be related to OpenHAB, or OSGi, so that is why i am mailing this to you and not to PubNub dev support. I am sorry if it turns out this isn't a problem of your competence and i am wasting your time.Anyway,From the karaf console when i run bundles:list i see my bundle as Installed, not as Active.When i run "restart [id]" it displays the following error:Unresolved requirement: Import-Package: com.pubnub.apia "resolve [id]" command does not yield anything visible.In my pom.xml i included this dependency:groupid: com.pubnubartifactid: pubnub-gsonversion: 4.31.0scope: providedAs per PubNub official documentation (source here https://www.pubnub.com/docs/java-se-java/pubnub-java-sdk ) this is the only dependency i need to add, so the required might be a transitive dependency.This is the feature.xml line i have added, following OpenHAB official documentation ( source here https://www.openhab.org/docs/developer/buildsystem.html ) :feature: openhab-runtime-basefeature prerequisite="true": wrapbundle dependency="true": wrap:mvn:com.pubnub/pubnub-gson/4.31.0I suppose i should provide some jar files to my bundle root or to my local maven .m2 folder, but i do not know which jar file and where to find it.PubNub has a general .jar file indicated in the documentation page above but i suppose Maven included it through my pom's dependency.Thank you for your time,hoping you can help me.Alessandro_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev