eclipse / paho.mqtt.android

MQTT Android
Other
2.92k stars 882 forks source link

NullPointerException in WebSocketReceiver #232

Open Max01010101010101 opened 7 years ago

Max01010101010101 commented 7 years ago

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)

nguyenlinhnttu commented 7 years ago

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'

jpwsutton commented 7 years ago

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)

shriharsha-bhagwat commented 5 years ago

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?

systane commented 4 years ago

@android-bash The fix submitted by @jpwsutton is available at version 1.2.2. I didn't check the version 1.2.1.

dongweiq commented 4 years ago

mark下,升级到1.2.2版本就没有问题了,可以愉快地和js版本的websocket通信了

mustafaboleken commented 3 years ago

It's solved. You can use paho.mqtt.java version 1.2.5

https://github.com/eclipse/paho.mqtt.java/commit/adc1160c8a2fffeffbb2eaec18d95814e41d4b5d