Hello
Since yesterday I started having some errors that I've never seen, and can't find where the problem is. The error seems to be cause by MQTT, when I receive a message from clients.
This is the error:
This is my line 65, it's actually the first line of a sub:
My app is both a Broker (jMQTTBroker) and a Client. I think this error is raised when the broker-client sends a message to everyone, including itself. When other clients send a message to my broker I don't get an error.
What is strange is that this error happens in debug mode several times in a row, but then when I switch to release, the error is gone.
Also strange is that I never seen any error like this until yesterday, but I didn't change that part of the code yesterday...
Any idea?
Thank you for your help.
[EDIT]
it happens with any client, not only when the broker sends itself a message
[EDIT]
seems to happen only in debug mode, works in release
Since yesterday I started having some errors that I've never seen, and can't find where the problem is. The error seems to be cause by MQTT, when I receive a message from clients.
This is the error:
B4X:
...
# Connected: true
Error occurred on line: 65
java.lang.NullPointerException
at anywheresoftware.b4a.shell.Shell.setStateBeforeUserSub(Shell.java:387)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:288)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at anywheresoftware.b4a.BA$3.run(BA.java:219)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
Error occurred on line: 65
java.lang.NullPointerException
at anywheresoftware.b4a.shell.Shell.runGoodChain(Shell.java:358)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:169)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at anywheresoftware.b4a.BA$3.run(BA.java:219)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
This is my line 65, it's actually the first line of a sub:
B4X:
(65) Sub Client_MessageArrived (Topic As String, Payload() As Byte)
....
My app is both a Broker (jMQTTBroker) and a Client. I think this error is raised when the broker-client sends a message to everyone, including itself. When other clients send a message to my broker I don't get an error.
What is strange is that this error happens in debug mode several times in a row, but then when I switch to release, the error is gone.
Also strange is that I never seen any error like this until yesterday, but I didn't change that part of the code yesterday...
Any idea?
Thank you for your help.
[EDIT]
it happens with any client, not only when the broker sends itself a message
[EDIT]
seems to happen only in debug mode, works in release
Last edited: