[SOLVED] Putting JAR files into addons folder - Unresolved requirement

  • Platform information:
    • OS: Win 10, 32 bit
    • Java Runtime Environment: jdk1.8.0_201
    • openHAB version: 2.5.0 SNAPSHOT, build #1555
  • Issue of the topic: WARN/ERROR when putting .JAR into ‘addons’ folder

I did a fresh install of OH2 (downloaded from here). Then I put org.openhab.binding.pioneeravr-2.5.0-SNAPSHOT.jar into ‘addons’ folder. I’ve downloaded it from here:

https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.pioneeravr/2.5.0-SNAPSHOT/
.
.
Then I got the following WARN/ERRORS in openhab.log:

Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

09:44:29.387 [WARN ] [org.apache.felix.fileinstall         ] - Error while starting bundle: file:/C:/Openhab2-1555/addons/org.openhab.binding.pioneeravr-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.pioneeravr [215]
  Unresolved requirement: Import-Package: gnu.io; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

        at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]

09:44:29.395 [WARN ] [org.apache.felix.fileinstall         ] - Error while starting bundle: file:/C:/Openhab2-1555/addons/org.openhab.binding.pioneeravr-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.pioneeravr [215]
  Unresolved requirement: Import-Package: gnu.io; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

        at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]

.
.
. The binding then is not “Active”, it’s only “Installed”.

215 │ Installed │  80 │ 2.5.0.201903150425    │ PioneerAvr Binding

.
.

When I install org.openhab.binding.pioneeravr binding via PaperUI, then the following dependent bundles were installed also, but then there are NO errors:

216 ¦ Active ¦  80 ¦ 2.5.2                 ¦ JUPnP Library
217 ¦ Active ¦  80 ¦ 2.5.0.201903120310    ¦ openHAB Core :: Bundles :: Configuration UPnP Discovery
218 ¦ Active ¦  80 ¦ 2.5.0.201903120310    ¦ openHAB Core :: Bundles :: UPnP Transport
219 ¦ Active ¦  80 ¦ 3.14.0                ¦ nrjavaserial
220 ¦ Active ¦  80 ¦ 3.15.0.OH2            ¦ nrjavaserial
221 ¦ Active ¦  80 ¦ 3.3.0                 ¦ Commons Net
222 ¦ Active ¦  80 ¦ 2.5.0.201903121821    ¦ PioneerAvr Binding
223 ¦ Active ¦  80 ¦ 2.5.0.201903120310    ¦ openHAB Core :: Bundles :: Configuration USB-Serial Discovery
224 ¦ Active ¦  80 ¦ 2.5.0.201903120310    ¦ openHAB Core :: Bundles :: Configuration USB-Serial Discovery for Linux using sysfs scanning
225 ¦ Active ¦  80 ¦ 2.5.0.201903120310    ¦ openHAB Core :: Bundles :: Configuration Serial
226 ¦ Active ¦  80 ¦ 2.5.0.201903120309    ¦ openHAB Core :: Bundles :: Serial Transport
227 ¦ Active ¦  80 ¦ 2.5.0.201903120310    ¦ openHAB Core :: Bundles :: Serial Transport for RXTX
228 ¦ Active ¦  80 ¦ 2.5.0.201903120310    ¦ openHAB Core :: Bundles :: Serial Transport for RFC2217

.
.
.
I know that “ESH Core” was currently integrated into OH2 Core. All mentioned bundles above were formerly named, e.g. in Snapshot build #1510:

199 │ Active    │  80 │ 0.11.0.201901181547    │ Eclipse SmartHome Configuration UPnP Discovery
200 │ Active    │  80 │ 0.11.0.201901181547    │ Eclipse SmartHome UPnP Transport Bundle
201 │ Active    │  80 │ 2.5.1                  │ JUPnP Library
217 │ Active    │  80 │ 3.14.0                 │ nrjavaserial
218 │ Active    │  80 │ 3.15.0.OH2             │ nrjavaserial
219 │ Active    │  80 │ 0.11.0.201901181547    │ Eclipse SmartHome Configuration USB-Serial Discovery
220 │ Active    │  80 │ 0.11.0.201901181547    │ Eclipse SmartHome Configuration USB-Serial Discovery Linux sysf Scanning
221 │ Active    │  80 │ 0.11.0.201901181547    │ Eclipse SmartHome Config Serial
222 │ Active    │  80 │ 0.11.0.201901181547    │ Eclipse SmartHome Serial Transport
223 │ Active    │  80 │ 0.11.0.201901181547    │ Eclipse SmartHome Serial Transport for RXTX
224 │ Active    │  80 │ 0.11.0.201901181547    │ Eclipse SmartHome Serial Transport extension for RXTX RFC2217
225 │ Active    │  80 │ 2.5.0.201902110612     │ PioneerAvr Binding

.
.
.
Could it be, that I downloaded the wrong .JAR file, because the dependencies do not get installed?
Or does the JAR file contain wrong dependencies in general?

Normally prerequisites are set here?


.
.
When I do:

feature:install openhab-transport-upnp
feature:install openhab-transport-serial

then the missing bundles above get installed!

What’s new here ?
Putting jar files in the addons folder has always required to install manually the dependencies (when they are not yet installed).

4 Likes

@Lolodomo

Ok, then I was in luck before. I never had to install any dependencies when I put JAR files into addons folder. Thanks for explaining it. Unfortunately, I did not know that. Is there a documentation? Why are dependencies not checked, shouldn’t it be possible?

EDIT:

New is (in the latest snapshot builds), that the missed dependencies (in error log) still have old package names, so don’t get irritated:

old name new name
Eclipse SmartHome Configuration UPnP Discovery openHAB Core :: Bundles :: Configuration UPnP Discovery
Eclipse SmartHome UPnP Transport Bundle openHAB Core :: Bundles :: UPnP Transport
Eclipse SmartHome Configuration USB-Serial Discovery openHAB Core :: Bundles :: Configuration USB-Serial Discovery
Eclipse SmartHome Configuration USB-Serial Discovery Linux sysf Scanning openHAB Core :: Bundles :: Configuration USB-Serial Discovery for Linux using sysfs scanning
Eclipse SmartHome Config Serial openHAB Core :: Bundles :: Configuration Serial
Eclipse SmartHome Serial Transport openHAB Core :: Bundles :: Serial Transport
Eclipse SmartHome Serial Transport for RXTX openHAB Core :: Bundles :: Serial Transport for RXTX
Eclipse SmartHome Serial Transport extension for RXTX RFC2217 openHAB Core :: Bundles :: Serial Transport for RFC2217
The Apache Commons Net library Commons Net
JUPnP Library JUPnP Library
nrjavaserial nrjavaserial

Here is the documentation! (available since version 2.4)

Attention: This option is adressed to advanced users. Installing add-on’s with a .jar file can lead to problems, because add-on dependencies may not be installed. Please make sure to use this option only in special cases (like add-on testing for an upcoming version) or when you know what you are doing.

2 Likes