Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] NPE thrown by MqttAndroidClient without any boject set to null

What about publishTopic?

Perhaps this is null.

2017-05-01 19:26 GMT+02:00 Sergio Torassa <sertorassa@xxxxxxxxxxx>:

Hello all

I'm trying to develop a very simple Android app based upon MQTT.

Just from the beginning I started with an NPE thrown by MqttAndroidClient.publish(String topic, MqttMessage message) method.

This is the excerpt of the code where the NPE is thrown:

try {
MqttMessage msg = new MqttMessage("test".getBytes());
mqttAndroidClient.publish(publishTopic, msg);
} catch (Exception e) {
throw new RuntimeException(e);
I checked both mqttAndroidClient and msg and neither of them are null.

From the MQTT documentation MqttAndroidClient.publish() method is not supposed to throw a NPE.

What could be the reason for that?



paho-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Manuel Domínguez Dorado
Software engineer (Ph.D, M.Sc., B.Sc.)
Certified Project Management Professional (PMP)

(+34) 607 418 760

Back to the top