Hi all! I have been developing a binding for the MerossIOT.
It relies on a library that I manufectured which in turn has multiple maven dependencies. The binding installs but it does not start. I get the following message:
Status: Installed
Unsatisfied Requirements:
osgi.wiring.package; filter:="(osgi.wiring.package=com.aayushatharva.brotli4j)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.aayushatharva.brotli4j.decoder)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.aayushatharva.brotli4j.encoder)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.github.luben.zstd)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.google.protobuf)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.google.protobuf.nano)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.jcraft.jzlib)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.ning.compress)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.ning.compress.lzf)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.ning.compress.lzf.util)"
osgi.wiring.package; filter:="(osgi.wiring.package=com.oracle.svm.core.annotate)"
osgi.wiring.package; filter:="(osgi.wiring.package=io.netty.channel.epoll)"
osgi.wiring.package; filter:="(osgi.wiring.package=io.netty.handler.codec.http)"
osgi.wiring.package; filter:="(osgi.wiring.package=io.netty.handler.codec.http.websocketx)"
osgi.wiring.package; filter:="(osgi.wiring.package=io.netty.handler.proxy)"
osgi.wiring.package; filter:="(osgi.wiring.package=io.netty.internal.tcnative)"
osgi.wiring.package; filter:="(osgi.wiring.package=lzma.sdk)"
osgi.wiring.package; filter:="(osgi.wiring.package=lzma.sdk.lzma)"
osgi.wiring.package; filter:="(osgi.wiring.package=net.jpountz.lz4)"
osgi.wiring.package; filter:="(osgi.wiring.package=net.jpountz.xxhash)"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.logging.log4j.status)(&(version>=2.23.0)(!(version>=3.0.0))))"
osgi.wiring.package; filter:="(osgi.wiring.package=org.bouncycastle.jsse)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.bouncycastle.jsse.provider)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.conscrypt)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.eclipse.jetty.npn)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.jboss.marshalling)"
osgi.wiring.package; filter:="(osgi.wiring.package=reactor.blockhound)"
osgi.wiring.package; filter:="(osgi.wiring.package=reactor.blockhound.integration)"
osgi.wiring.package; filter:="(osgi.wiring.package=sun.security.ssl)"
osgi.wiring.package; filter:="(osgi.wiring.package=sun.security.x509)"
Declarative Services
I realized that the issue is probably related to the binding dependencies and to the OSGi’s package visibility queston.
Here is the library’s bundle manifest:
Manifest-Version: 1.0
Bnd-LastModified: 1727861613123
Build-Jdk-Spec: 17
Bundle-Activator: org.meross4j.bundle.Activator
Bundle-Description: meross4j is a Java library for the Meross cloud
Bundle-License: https://www.eclipse.org/legal/epl-2.0
Bundle-ManifestVersion: 2
Bundle-Name: meross4j Meross Java library
Bundle-SymbolicName: meross4j
Bundle-Version: 0.2.5.20241002-0933
Created-By: Apache Maven Bundle Plugin 5.1.9
Export-Package: org.meross4j;uses:="com.google.gson,com.hivemq,org.apach
e.commons.codec,org.slf4j,org.jetbrains.annotations,osgi.framework";ver
sion="0.2.5"
Import-Package: com.google.gson;version="[2.10,3)",com.google.gson.annot
ations;version="[2.10,3)",com.google.gson.reflect;version="[2.10,3)",co
m.hivemq.client.mqtt;version="[1.3,2)",com.hivemq.client.mqtt.datatypes
;version="[1.3,2)",com.hivemq.client.mqtt.mqtt5;version="[1.3,2)",com.h
ivemq.client.mqtt.mqtt5.message.auth;version="[1.3,2)",com.hivemq.clien
t.mqtt.mqtt5.message.connect;version="[1.3,2)",com.hivemq.client.mqtt.m
qtt5.message.publish;version="[1.3,2)",com.hivemq.client.mqtt.mqtt5.mes
sage.subscribe;version="[1.3,2)",com.hivemq.client.mqtt.mqtt5.message.s
ubscribe.suback;version="[1.3,2)",java.io,java.lang,java.lang.invoke,ja
va.lang.runtime,java.net,java.net.http,java.nio,java.nio.charset,java.n
io.file,java.time,java.time.temporal,java.util,java.util.concurrent,jav
a.util.function,java.util.stream,org.apache.commons.codec.digest;versio
n="[1.17,2)",org.osgi.framework;version="[1.8,2)",org.slf4j;version="[1
.7,2)"
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=17))"
Tool: Bnd-6.3.1.202206071316
The binding is trying to import the packages which cause the error. I tried with OSGi uses:=
directive to solve the issue but I am new to the framework. How can I satisfy those requirements as I guess they are internal to meross4j lib?
Btw, I have been reading the OSGi in action book by Manning
Thanks