Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in Paho MQTT when using close() and autoReconnect(true) #1093

Closed
growse opened this issue Oct 4, 2021 · 0 comments
Closed

NPE in Paho MQTT when using close() and autoReconnect(true) #1093

growse opened this issue Oct 4, 2021 · 0 comments
Milestone

Comments

@growse
Copy link
Collaborator

growse commented Oct 4, 2021

From play store:

java.lang.NullPointerException: 
  at org.eclipse.paho.client.mqttv3.internal.ClientComms.setReconnectCallback (ClientComms.java:605)
  at org.eclipse.paho.client.mqttv3.MqttAsyncClient.connect (MqttAsyncClient.java:749)
  at org.eclipse.paho.client.mqttv3.MqttAsyncClient.attemptReconnect (MqttAsyncClient.java:1428)
  at org.eclipse.paho.client.mqttv3.MqttAsyncClient.access$2 (MqttAsyncClient.java:1423)
  at org.eclipse.paho.client.mqttv3.MqttAsyncClient$ReconnectTask.run (MqttAsyncClient.java:1467)
  at java.util.TimerThread.mainLoop (Timer.java:562)
  at java.util.TimerThread.run (Timer.java:512)
java.lang.NullPointerException: 
  at org.eclipse.paho.client.mqttv3.internal.ConnectActionListener.onFailure (ConnectActionListener.java:119)
  at org.eclipse.paho.client.mqttv3.internal.ConnectActionListener.connect (ConnectActionListener.java:188)
  at org.eclipse.paho.client.mqttv3.MqttAsyncClient.connect (MqttAsyncClient.java:766)
  at org.eclipse.paho.client.mqttv3.MqttAsyncClient.attemptReconnect (MqttAsyncClient.java:1428)
  at org.eclipse.paho.client.mqttv3.MqttAsyncClient.access$2 (MqttAsyncClient.java:1423)
  at org.eclipse.paho.client.mqttv3.MqttAsyncClient$ReconnectTask.run (MqttAsyncClient.java:1467)
  at java.util.TimerThread.mainLoop (Timer.java:562)
  at java.util.TimerThread.run (Timer.java:512)

Think we need to disconnect() rather than close(), as close() nulls out a bunch of stuff that might be then used by the reconnect logic.

@growse growse closed this as completed in 8fc6f6b Oct 4, 2021
@growse growse added this to the v2.4.3 milestone Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant