[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

Hi Sergio, 
 
Could you provide the stack trace please, It might help with identifying the cause.
 
Kind regards,
 
James Sutton
Software Engineer - IoT Foundation - MQTT Open Source Projects
Ops Team - Wimbledon Project

Phone: 01962 815438 | Extension: x372454
E-mail: 
Personal Website: www.jsutton.co.uk
Find me on:     
IBM

Hursley Park
HursleySO212JN
United Kingdom
 
IBM United Kingdom Limited Registered in England and Wales with number 741598 Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU
 
 
----- Original message -----
From: Sergio Torassa <sertorassa@xxxxxxxxxxx>
Sent by: paho-dev-bounces@xxxxxxxxxxx
To: General development discussions for paho project <paho-dev@xxxxxxxxxxx>, "ingeniero@xxxxxxxxxxxxxxxxxxx" <ingeniero@xxxxxxxxxxxxxxxxxxx>
Cc:
Subject: Re: [paho-dev] NPE thrown by MqttAndroidClient without any boject set to null
Date: Mon, May 1, 2017 7:40 PM
 

I forgot to mention that also topic is not null. It is a string

Il 01/mag/2017 20:01, Manuel DomÃnguez Dorado <manolodd@xxxxxxxxx> ha scritto:
>
> 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?
>>
>>
>> Thanks
>>
>> Sergio
>>
>>
>> _______________________________________________
>> paho-dev mailing list
>> paho-dev@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>
>
>
>
> --
> ---
> Manuel DomÃnguez Dorado
> Software engineer (Ph.D, M.Sc., B.Sc.)
> Certified Project Management Professional (PMP)
> ingeniero@xxxxxxxxxxxxxxxxxxx
> http://www.ManoloDominguez.com
> (+34) 607 418 760
>

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev
 
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU