Hardware: CPUArchitecture/RAM/storage
AMD64 Linux on Gigabyte BRIX AMD A6
OS: what OS is used and which version
Ubuntu 19.10
Java Runtime Environment: which java platform is used and what version
Part of Docker
openHAB version:
2.5.3 Docker amd64-debian
Issue of the topic: please be detailed explaining your issue
Trying to look at teh mqttv2 binding since that seems to be the way forward. mqtt broker is creating via thing.
Have also tried creating another one in paper ui (with another name/client id) - this stays in Uninitialized state.
The error I see in the log after restarting the mqtt binding in karaf is:
2020-04-19 13:00:53.859 [ERROR] [org.openhab.binding.mqtt ] - bundle org.openhab.binding.mqtt:2.5.3 (269)[org.openhab.binding.mqtt.internal.MqttBrokerHandlerFactory(281)] : Error during in
stantiation of the implementation object
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.binding.mqtt.internal.MqttBrokerHandlerFactory
2020-04-19 13:00:53.869 [ERROR] [org.openhab.binding.mqtt ] - bundle org.openhab.binding.mqtt:2.5.3 (269)[org.openhab.binding.mqtt.internal.MqttBrokerHandlerFactory(281)] : Error during in
stantiation of the implementation object
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.binding.mqtt.internal.MqttBrokerHandlerFactory
2020-04-19 13:00:53.878 [ERROR] [org.openhab.binding.mqtt ] - bundle org.openhab.binding.mqtt:2.5.3 (269)[org.openhab.binding.mqtt.internal.MqttBrokerHandlerFactory(281)] : Error during in
stantiation of the implementation object
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.binding.mqtt.internal.MqttBrokerHandlerFactory
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_232]
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
There’s 3 errors there I think they’re all the same. I look at the bundle list as see a couple as Waiting.
I did just see a post that said mqttv1 and 2 were incompatible? I didn’t think this was the case. I still heavily use MQTTv1 as I have not converted all my devices over yet.
Any errors in the log when the .things file is loaded?
Are you using code fences above? The newline after "Network and the closing quote gives my pause.
I don’t use .things files for MQTT and don’t recommend them so won’t be of much help with the file. One thing that does catch a lot of people up is not having a unique Client ID for each broker Thing (and also the mqtt.cfg, they all have to be different from each other and different from any other client that logs into that broker).
The error posted above hints at a failed or corrupted binding install. I myself am running MQTT 2.5.3 so it should be possible to run it. You can try uninstalling it and reinstalling just the binding or go full on clear the cache and force the reinstallation of all your add-ons.
The fact that you have two MQTT bundles in the “Waiting” state is suspicious for sure. And the fact that one of them is the Broker Binding could explain the behavior.
Thanks @psyciknz. Works for me. Guess it’s time to migrate the remaining v1 items to v2 now.
I’m quite happy to work with the .things config file. Unfortunatelly, the latest binding documentation doesn’t include examples any longer!
Here is an example thing thing in mqttv2. Note the broker I created via the UI and the broker thing is referenced - mqtt:broker:7d0ef5b3. The bindings page (https://www.openhab.org/addons/bindings/mqtt.generic/) has all of the pertinent information to set up the channel types and options. I’ve since switched to using “homie” discovery to avoid even having to keep track of these configurations but this works.
(for the thing name - mqtt:topic:hubitat:66 - i think it is important that be4 parts. first two set as mqtt:topic: - the third one I made match the name of my broker thing - the fourth a unique id for this device.)