giggetto71 Active Member Licensed User Longtime User Jul 14, 2023 #1 Hi, I have seen in jMQTT Erel's original post that only the B4J version is updated to the latest 1.25 while the B4A is not updated. I am struggling from years with an error from the Google console on my app saying: NullPointerException: Attempt to invoke virtual method 'void org.eclipse.paho.client.mqttv3.internal.CommsTokenStore.quiesce(org.eclipse.paho.client.mqttv3.MqttException)' on a null object reference which I have never been not able to reproduce and which I seriously doubt it has to to do with the code. I am more and more convinced that it has to be some kind of internal library hidden issue that I really hope it got fixed by the 1.25 version. for example in version 1.2 rel notes they fixed something which looks quite similar... NPE when MqttAsyncClient is closed after unsuccessful connect · Issue #194 · eclipse-paho/paho.mqtt.java Steps to reproduce: Call MqttAsyncClient.connect() Immediately after IMqttActionListener.onFailure() is called, call MqttAsyncClient.close() Issue: MqttAsyncClient.connect() creates the shutdownCon... github.com Is there a reason why the B4A lib cannot be updated to the latest ? thanks for your help. Last edited: Jul 14, 2023
Hi, I have seen in jMQTT Erel's original post that only the B4J version is updated to the latest 1.25 while the B4A is not updated. I am struggling from years with an error from the Google console on my app saying: NullPointerException: Attempt to invoke virtual method 'void org.eclipse.paho.client.mqttv3.internal.CommsTokenStore.quiesce(org.eclipse.paho.client.mqttv3.MqttException)' on a null object reference which I have never been not able to reproduce and which I seriously doubt it has to to do with the code. I am more and more convinced that it has to be some kind of internal library hidden issue that I really hope it got fixed by the 1.25 version. for example in version 1.2 rel notes they fixed something which looks quite similar... NPE when MqttAsyncClient is closed after unsuccessful connect · Issue #194 · eclipse-paho/paho.mqtt.java Steps to reproduce: Call MqttAsyncClient.connect() Immediately after IMqttActionListener.onFailure() is called, call MqttAsyncClient.close() Issue: MqttAsyncClient.connect() creates the shutdownCon... github.com Is there a reason why the B4A lib cannot be updated to the latest ? thanks for your help.
Erel B4X founder Staff member Licensed User Longtime User Jul 16, 2023 #2 giggetto71 said: Is there a reason why the B4A lib cannot be updated to the latest ? Click to expand... Yes, the underlying library is no longer compatible with Android. Upvote 0
giggetto71 said: Is there a reason why the B4A lib cannot be updated to the latest ? Click to expand... Yes, the underlying library is no longer compatible with Android.
giggetto71 Active Member Licensed User Longtime User Jul 19, 2023 #3 ok. is there another mqtt library available in B4A? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 20, 2023 #4 No and I'm not convinced that the problem is in the library. You need to provide more information. There are many apps using that library. Upvote 0
No and I'm not convinced that the problem is in the library. You need to provide more information. There are many apps using that library.
giggetto71 Active Member Licensed User Longtime User Jul 20, 2023 #5 I understand and in general that is a great library. it is also true that for sure that NPE is triggered my my code but the console does not help as this is all it shows. Exception java.lang.NullPointerException: Attempt to invoke virtual method 'void org.eclipse.paho.client.mqttv3.internal.CommsTokenStore.quiesce(org.eclipse.paho.client.mqttv3.MqttException)' on a null object reference at org.eclipse.paho.client.mqttv3.internal.ClientComms.shutdownConnection (ClientComms.java:310) at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run (ClientComms.java:608) at java.lang.Thread.run (Thread.java:764) which to me looks all internal to the libray. plus the signature which is "CommsTokenStore.quiesce" matches perfectly with the bug fixed in the 1.2 rel. Anyway...I don't want to be a pain in the....so I will just live with this bug. it's not the end of the world. Upvote 0
I understand and in general that is a great library. it is also true that for sure that NPE is triggered my my code but the console does not help as this is all it shows. Exception java.lang.NullPointerException: Attempt to invoke virtual method 'void org.eclipse.paho.client.mqttv3.internal.CommsTokenStore.quiesce(org.eclipse.paho.client.mqttv3.MqttException)' on a null object reference at org.eclipse.paho.client.mqttv3.internal.ClientComms.shutdownConnection (ClientComms.java:310) at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run (ClientComms.java:608) at java.lang.Thread.run (Thread.java:764) which to me looks all internal to the libray. plus the signature which is "CommsTokenStore.quiesce" matches perfectly with the bug fixed in the 1.2 rel. Anyway...I don't want to be a pain in the....so I will just live with this bug. it's not the end of the world.
techknight Well-Known Member Licensed User Longtime User Jul 25, 2023 #6 Wonder what makes it not compatible with Android? It does concern me because I use MQTT daily for all my apps, I heavily rely on it. The original repo is dead for android but it got forked over here : GitHub - hannesa2/paho.mqtt.android: Kotlin MQTT client for Android Kotlin MQTT client for Android . Contribute to hannesa2/paho.mqtt.android development by creating an account on GitHub. github.com They have a compiled AAR file, but i have zero idea how to write a library/wrapper for that. Theres also the HiveMQ Android library that could be used as well but idk how drastic of a change that would be considering the former is still based on paho. Last edited: Jul 25, 2023 Upvote 0
Wonder what makes it not compatible with Android? It does concern me because I use MQTT daily for all my apps, I heavily rely on it. The original repo is dead for android but it got forked over here : GitHub - hannesa2/paho.mqtt.android: Kotlin MQTT client for Android Kotlin MQTT client for Android . Contribute to hannesa2/paho.mqtt.android development by creating an account on GitHub. github.com They have a compiled AAR file, but i have zero idea how to write a library/wrapper for that. Theres also the HiveMQ Android library that could be used as well but idk how drastic of a change that would be considering the former is still based on paho.