Hi openHAB Community,
I am developing a binding simply called opcua
for openHAB 3 which uses OPCUA as protocol.
For supporting this protocol, my binding relies on eclipse milo (github) which is also published to maven central.
The dependency tree of my binding looks like this (leaving out openhab dependencies and bundles):
org.openhab.addons.bundles:org.openhab.binding.opcua:jar:3.4.0-SNAPSHOT
+- org.eclipse.milo:sdk-client:jar:0.6.7:compile
| +- org.eclipse.milo:stack-client:jar:0.6.7:compile
| | +- org.eclipse.milo:stack-core:jar:0.6.7:compile
| | | +- org.bouncycastle:bcprov-jdk15on:jar:1.69:compile
| | | +- com.google.guava:guava:jar:31.0.1-jre:compile
| | | | +- com.google.guava:failureaccess:jar:1.0.1:compile
| | | | \- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
| | | \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.6:compile
| | | +- org.glassfish.jaxb:txw2:jar:2.3.6:compile
| | | \- com.sun.istack:istack-commons-runtime:jar:3.0.12:compile
| | +- com.digitalpetri.netty:netty-channel-fsm:jar:0.8:compile
| | | \- com.digitalpetri.fsm:strict-machine:jar:0.6:compile
| | \- io.netty:netty-codec-http:jar:4.1.77.Final:compile
| \- org.eclipse.milo:sdk-core:jar:0.6.7:compile
The binding was created using the official skeleton script present in the addon git repository.
Adding the dependency as defined in the tutorials on the openHAB developer pages does however yield errors when trying to resolve the requirements:
Resolution failed. Capabilities satisfying the following requirements could not be found:
[<<INITIAL>>]
â osgi.identity: (osgi.identity=org.openhab.binding.opcua)
â [org.openhab.binding.opcua version=3.4.0.202207270859]
â osgi.wiring.package: (osgi.wiring.package=com.digitalpetri.netty.fsm)
[org.apache.karaf.kar.core version=4.3.7]
â osgi.service: (objectClass=org.apache.karaf.features.FeaturesService)
Troubleshooting so far
The binding only has a single depedency added to the pom of the opcua
binding:
<artifactId>org.openhab.binding.opcua</artifactId>
...
<dependencies>
<dependency>
<groupId>org.eclipse.milo</groupId>
<artifactId>sdk-client</artifactId>
<version>0.6.7</version>
<scope>compile</scope>
</dependency>
</dependencies>
...
The binding itself is correctly added into the addons project (included in both addons/pom.xml as well as bundles/pom.xml).
The package bnd tries to import is not an osgi bundle!
Any misconfiguration with the setup can be ruled out as it is a clean setup with eclipse and jdk11 (zulu).
Running openHAB with the bundle opcua
works without any issues if the dependency is removed together with the code that calls/relies on it!
Wrapping the dependency with wrap:mvn:org.eclipse.milo
and adding it in the features of the bundle does result in errors.
Interestingly enough is that, excluding the transistive dependency which throws the error only resolves to additional errors about netty not being resolved.
So my guess is that it is a resolver error, not a package error?!
Unresolved requirement: Import-Package: io.netty.buffer; version="[4.1.0,5.0.0)
Have I missed any necessary configuration steps in openHAB itself or the bundle to resolve transitive non OSGi depdendencies in my bundle?!
How can I resolve the errors and help the bnd plugin pulling the dependencies into the bundle?
Thanks,
Gernot