tobof / openhab-addons

The next-generation open Home Automation Bus (openHAB)
Eclipse Public License 2.0
39 stars 30 forks source link

BundleException while using jar compiled from latest source #124

Closed FredericMa closed 5 years ago

FredericMa commented 5 years ago

Hi,

I downloaded today the latest source and compiled the jar from it. When I put the jar in the addons folder I get the following exception:

2018-10-01 13:58:27.647 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/C:/OpenHAB/addons/org.openhab.binding.mysensors-2.4.0-SNAPSHOT.jar org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mysensors [261] Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional" Unresolved requirement: Import-Package: org.eclipse.smarthome.io.transport.mqtt

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]

I'm using OpenHAB 2.4.0 M4 on a Windows Server 2012 with Java 8 update 181 64 bit installed.

tobof commented 5 years ago

There was a change in the MQTT API (of ESH / OH2) that is not backward compatible. So you need to upgrade OH2 to the latest Snapshot or use the "old" binding, provided in the Eclipse marketplace.

FredericMa commented 5 years ago

Oh ok, but my current snapshot is the last milestone build from September 25th. I guess you are refering to this PR of July 6th? https://github.com/eclipse/smarthome/pull/5862 In that case it will already be included in my current snapshot.

tobof commented 5 years ago

Is the esh-mqtt feature still in place? feature:install esh-io-transport-mqtt

FredericMa commented 5 years ago

No indeed. When I installed that one it started working. But in my bundle list I now see the following entries: org.openhab.io.transport.mqtt and org.eclipse.smarthome.io.transport.mqtt

The first one was already installed by installing the MQTT binding. Is there a difference between the smarthome and openhab transport bundle? Otherwise it is maybe better to also use org.openhab.io.transport.mqtt for the MySensors binding.

tobof commented 5 years ago

The openhab.io implementation is used by the old mqtt1 binding. This binding uses the "new" MQTT implementation from ESH. I'll close this issue, as the problem is solved. :-)