paho.mqtt.java
paho.mqtt.java copied to clipboard
validateQos() Crash
Please fill out the form below before submitting, thank you!
- [x ] Bug exists Release Version 1.1.1 ( Master Branch)
- [ ] Bug exists in Snapshot Version 1.1.2-SNAPSHOT (Develop Branch)
This is the stacktrace:
Fatal Exception: java.lang.IllegalArgumentException
at org.eclipse.paho.client.mqttv3.MqttMessage.validateQos(MqttMessage.java:41)
at org.eclipse.paho.client.mqttv3.MqttMessage.setQos(MqttMessage.java:181)
at org.eclipse.paho.client.mqttv3.internal.wire.MqttPublish.(MqttPublish.java)
at org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage.createWireMessage(MqttWireMessage.java:193)
at org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage.createWireMessage(MqttWireMessage.java:167)
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:119)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:116)
at java.lang.Thread.run(Thread.java:841)
I understand that validateQos()
is receiving an invalid QOS, but is the client trying to publish that invalid QOS message or is it received on the client in a malformed way from the broker?
As per my understanding of this stack trace, the client received a msg which it failed to convert into a valid MqttMessage due to an invalid QOS. Is that right? It's a confusing stacktrace :(
Facing the same issue.
@ishaansrm & @IanWambai What type of MQTT Server are you using?
Mosquitto broker
Same.
@jpwsutton were you able to figure out what's causing the issue?
@IanWambai Sadly not as I cannot re-create this issue myself. Could you enable logging following the instructions here and show us the log messages that appear with this exception please?
Will enable logging too. Please note that I've been able to see the issue only in production, never on my test bed.
Is it possible to enable logging in production java (android) apps? If yes then how? As per my understanding we need to push the props file to java client but that's be difficult to do for production clients.
This crash is only seen in production.
You would need to modify the launch command to include the -Djava.util.logging.config.file=/path/to/logging/file
, that's the only requirement.
Hi, have u fixed this bug?
I have the same issue. I received this exception log without a clear cause. As this can't be caught outside of the library's code, I propose catching this internally.
For me this issue was because of wrong server address/port as serverURI in new MqttClient(...). As you can see
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:116)
~ feels like message incoming decode fails.
I am facing this issue randomly in my Android application. As this exception can not be caught outside of the library, this need to be caught in the library itself.
Fix of this crash is needed.
For me this issue was because of wrong server address/port as serverURI in new MqttClient(...). As you can see
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:116)
~ feels like message incoming decode fails.
Right, but how do I know if the address/port is correct?