openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.56k forks source link

[mqtt] MQTT Broker Errors for SSL when none specified #7699

Closed kmccmk9 closed 6 months ago

kmccmk9 commented 4 years ago

Expected Behavior

When configuring the MQTT Broker, without SSL or cert checks it should successfully connect provided the mqtt server is configured properly.

Current Behavior

Currently it does not connect citing "HANDLER_INITIALIZING_ERROR"

I see the following stack trace in the logs.

2020-05-08 18:13:51.390 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing ‘mqtt:broker:a7533eb9’: org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection.setTrustManagers([Ljavax/net/ssl/TrustManager;)V
java.lang.NoSuchMethodError: org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection.setTrustManagers([Ljavax/net/ssl/TrustManager;)V
at org.openhab.binding.mqtt.handler.BrokerHandler.assignSSLContextProvider(BrokerHandler.java:139) ~[?:?]
at org.openhab.binding.mqtt.handler.BrokerHandler.initialize(BrokerHandler.java:230) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [137:org.openhab.core:2.5.0.201907171010]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [137:org.openhab.core:2.5.0.201907171010]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]

Possible Solution

Steps to Reproduce (for Bugs)

  1. SSH into openHABian
  2. Ran the config tool
  3. Added Mosquitto from the additional components
  4. Restarted mosquitto service and openhab2 service and check for errors
  5. Reboot machine
  6. Within PaperUI I made sure to add the MQTT binding
  7. Configure the binding with my username and password within paperui as well. (openhabian) and the password provided during installation

Context

I am trying to connect to a local instance of mosquitto. I am able to connect without SSL using external clients and pub/sub on various topics without issue.

Your Environment

lsiepel commented 6 months ago

This issue is allmost 4 years old. I tried to reproduce it, but failed. I don't see any other reports or follow ups. I close this for now, if needed or if you can reproduce this with openHAB 4.1.x just re-open this issue.