I am trying to load an OSGI bundle in an extension...
# lucee
b
I am trying to load an OSGI bundle in an extension I am writing and can't seem to get it to work. Hoping someone can point me in the right direction. The package I am having trouble with is jnats. Lucee says it is unable to resolve requirements
osgi.wiring.package=io.nats.client
Below is the MANIFEST.MF file for my jar and also the MANIFEST.MF file for the package I am trying to use.
Copy code
Manifest-Version: 1.0
Built-By: brandon
Build-Jdk: 1.8
Created-By: brandon
Bundle-ManifestVersion: 2
Bundle-Name: LuceeNATS
Bundle-SymbolicName: net.testing.luceenats
Bundle-Version: 2.0.1
Export-Package: net.testing.lucee.nats;uses:="javax.servlet,lucee.runtime,lucee.runtime.exp,lucee.runtime.listener,jnats;version="2.14.0",net.twentyonesolutions.luceeapps";version="2.0.0"
Import-Package: javax.servlet,javax.servlet.http,lucee.runtime,lucee.runtime.exp,lucee.runtime.listener,lucee.runtime.type.scope,lucee.runtime.util,<http://net.twentyonesolutions.lucee.app|net.twentyonesolutions.lucee.app>,net.twentyonesolutions.lucee.core,io.nats.client
Comment: (use this line if using javax.websocket-api for javax.websocket as opposed to bootdelegate) Import-Package: javax.servlet,javax.servlet.http,lucee.runtime,lucee.runtime.exp,lucee.runtime.listener,lucee.runtime.type.scope,lucee.runtime.util,<http://net.twentyonesolutions.lucee.app|net.twentyonesolutions.lucee.app>,io.nats.client
Copy code
Manifest-Version: 1.0
Automatic-Module-Name: io.nats.jnats
Bnd-LastModified: 1646784054419
Bundle-ManifestVersion: 2
Bundle-Name: jnats
Bundle-SymbolicName: jnats
Bundle-Version: 2.14.0
Created-By: 1.8.0_292 (AdoptOpenJDK)
Implementation-Title: Java Nats
Implementation-Vendor: <http://nats.io|nats.io>
Implementation-Version: 2.14.0
Private-Package: io.nats.client,io.nats.client.api,io.nats.client.impl
 ,io.nats.client.support
Require-Capability: <http://osgi.ee;filter:=%22(&(osgi.ee=JavaSE)(version=1.8))%22|osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))">
Tool: Bnd-5.1.2.202007211702
d
Just curious if the osgiLoader.cfc resolves your issue: https://github.com/cfsimplicity/luceeOsgiLoader If you haven't seen this yet, I recommend you read this thread: https://dev.lucee.org/t/how-to-use-an-osgi-bundle-which-is-not-included-by-default/3160