paho.mqtt.android
paho.mqtt.android copied to clipboard
NullPointerException in WebSocketReceiver
Please fill out the form below before submitting, thank you!
This bug exists Release Version 1.1.1 (Java Repository Master Branch) Also this bug exists in Snapshot Version 1.1.2-SNAPSHOT (Android Service Repository Master Branch)
The android version bug Seen on is 6
Console Log output:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.lang.Thread.join()' on a null object reference at org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketReceiver.stop(WebSocketReceiver.java:85) at org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketReceiver.run(WebSocketReceiver.java:120) at java.lang.Thread.run(Thread.java:818)
I also have the same error as you. I use version : compile 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.1' compile 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
Looks like an issue with the Java client, somehow the thread is null. I've put a fix forward today which will be built in the Java SNAPSHOTS. (https://github.com/eclipse/paho.mqtt.java/commit/adc1160c8a2fffeffbb2eaec18d95814e41d4b5d)
Is this issue resolved? I am still facing this issue in following version : implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0'
What steps need to be taken to avoid this issue?
@android-bash The fix submitted by @jpwsutton is available at version 1.2.2. I didn't check the version 1.2.1.
mark下,升级到1.2.2版本就没有问题了,可以愉快地和js版本的websocket通信了
It's solved. You can use paho.mqtt.java version 1.2.5
https://github.com/eclipse/paho.mqtt.java/commit/adc1160c8a2fffeffbb2eaec18d95814e41d4b5d