paho.mqtt.android icon indicating copy to clipboard operation
paho.mqtt.android copied to clipboard

NullPointerException in WebSocketReceiver

Open Max01010101010101 opened this issue 7 years ago • 6 comments

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)

Max01010101010101 avatar Aug 11 '17 00:08 Max01010101010101

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'

nguyenlinhnttu avatar Aug 21 '17 11:08 nguyenlinhnttu

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)

jpwsutton avatar Aug 25 '17 13:08 jpwsutton

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?

shriharsha-bhagwat avatar Dec 31 '18 10:12 shriharsha-bhagwat

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

systane avatar Oct 07 '19 19:10 systane

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

dongweiq avatar Mar 27 '20 05:03 dongweiq

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

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

mustafaboleken avatar Jun 24 '21 12:06 mustafaboleken