Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Callback exception

my 2c

If the exception had been thrown by observer, it would have been catched.
Are you sure it is not related to logger?

sergio

On 16/07/2015 15:42, Seif Eddine Jemli wrote:
Hi,

I am just calling a method on a non null object in that line.

@Override
public void messageArrived(String topic, MqttMessage message) throws Exception {
logger.debug(" Topic:" + topic + ("| Message: " + new String(message.getPayload())));
System.out.println("-------------------------------------------------");
System.out.println("| Topic:" + topic);
System.out.println("| Message: " + new String(message.getPayload()));
System.out.println("-------------------------------------------------");
try{
//notify the class responsible for the communication with A2NETS of the message sent by the agent
observer.update(message,topic);
}
catch(Exception e)
{
logger.info("-------------Exception dans appel méthode update " + e.getCause() );

}

}

I verified if the object observer is null, but it wasn't.

2015-07-16 10:10 GMT+02:00 Nicholas O'Leary <nick.oleary@xxxxxxxxx>:
Hi,

that is a NPE in code outside of the paho client:
   org.bull.a2nets.MyInterwokringProxy.broker.SimpleMqttClient.messageArrived(SimpleMqttClient.java:197)

You should look at that code first to see what is throwing the null pointer.

NIck

On 16 July 2015 at 09:03, Seif Eddine Jemli <seifeddinejemli@xxxxxxxxx> wrote:

I am using eclipse.paho as a client. I get these errors when I publish a message on a topic that my client is subscribed to.

 DEBUG [org.eclipse.paho.client.mqttv3.internal.CommsCallback]: a/topic: callback threw exception
    java.lang.NullPointerException
            at org.bull.a2nets.MyInterwokringProxy.broker.SimpleMqttClient.messageArrived(SimpleMqttClient.java:197)
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:354)
            at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:162)

What can be the solution? thanks.


_______________________________________________
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


_______________________________________________
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



_______________________________________________
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


Back to the top