Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerExecption #94

Open
QX-Zach opened this issue Oct 9, 2017 · 5 comments
Open

NullPointerExecption #94

QX-Zach opened this issue Oct 9, 2017 · 5 comments

Comments

@QX-Zach
Copy link

QX-Zach commented Oct 9, 2017

E/AndroidRuntime: FATAL EXCEPTION: hawtdispatch-DEFAULT-2
Process: personal.zach.gprsdemo, PID: 18304
java.lang.NullPointerException: Attempt to invoke interface method 'boolean org.fusesource.hawtdispatch.transport.Transport.offer(java.lang.Object)' on a null object reference
at org.fusesource.mqtt.client.CallbackConnection$7.run(CallbackConnection.java:450)
at org.fusesource.hawtdispatch.transport.HeartBeatMonitor$3.run(HeartBeatMonitor.java:87)
at org.fusesource.hawtdispatch.transport.HeartBeatMonitor$1.run(HeartBeatMonitor.java:65)
at org.fusesource.hawtdispatch.internal.SerialDispatchQueue.run(SerialDispatchQueue.java:100)
at org.fusesource.hawtdispatch.internal.pool.SimpleThread.run(SimpleThread.java:77)

@laviua
Copy link

laviua commented Dec 29, 2017

                                                           java.lang.NullPointerException
                                                               at org.fusesource.mqtt.codec.MQTTProtocolCodec.encode(MQTTProtocolCodec.java:70)
                                                               at org.fusesource.hawtdispatch.transport.AbstractProtocolCodec.write(AbstractProtocolCodec.java:139)
                                                               at org.fusesource.hawtdispatch.transport.TcpTransport.offer(TcpTransport.java:653)
                                                               at org.fusesource.mqtt.client.CallbackConnection.send(CallbackConnection.java:698)
                                                               at org.fusesource.mqtt.client.CallbackConnection.send(CallbackConnection.java:684)
                                                               at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:630)
                                                               at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:619)

The same.
Issue appears only with callback connection type

during:
nextWriteBuffer.write(digit);
nextWriteBuffer is null

@Jin-here
Copy link

Jin-here commented Dec 29, 2017

@laviua I have replace this sdk with paho.mqtt.java, and it works well.

@laviua
Copy link

laviua commented Dec 29, 2017

@VolodymyrCj, yes, i know )
anyway thanks for you answer

@QX-Zach
Copy link
Author

QX-Zach commented Jan 18, 2018

this because of the signal of wifi is not stable. mqtt will reconnect frequent,and cause the thread stack overflow.
now,i use the following settings.

mqtt.setConnectAttemptsMax(10L);
mqtt.setReconnectAttemptsMax(-1);
mqtt.setReconnectDelay(100L);
mqtt.setReconnectDelayMax(30000L);
mqtt.setReconnectBackOffMultiplier(2);

but it does't work.

@c2545500
Copy link

You can judge the network status
And cancel the connection

你可以判断网络状态
并且取消连接

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants