B4J Question Websocket problem

Philip Prins

Active Member
Licensed User
Hello ,

I have a problem with Websocket server.
After a while i get the following error:
B4X:
    at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    ... 10 more
java.lang.RuntimeException: java.lang.IllegalStateException: Invalid for read: id=node0151rnzl6kif891o6vcdeuacgim577 created=1548000997197 accessed=1548000997197 lastaccessed=1548000997197 maxInactiveMs=10800000 expiry=1548011797197
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:120)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:126)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:191)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Invalid for read: id=node0151rnzl6kif891o6vcdeuacgim577 created=1548000997197 accessed=1548000997197 lastaccessed=1548000997197 maxInactiveMs=10800000 expiry=1548011797197
    at org.eclipse.jetty.server.session.Session.checkValidForRead(Session.java:631)
    at org.eclipse.jetty.server.session.Session.getAttribute(Session.java:657)
    at anywheresoftware.b4j.object.HttpSessionWrapper.GetAttribute(HttpSessionWrapper.java:47)
    at b4j.example.voip._a_p(voip.java:39)
    at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    ... 10 more
java.lang.RuntimeException: java.lang.IllegalStateException: Invalid for read: id=node0151rnzl6kif891o6vcdeuacgim577 created=1548000997197 accessed=1548000997197 lastaccessed=1548000997197 maxInactiveMs=10800000 expiry=1548011797197
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:120)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:126)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:191)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Invalid for read: id=node0151rnzl6kif891o6vcdeuacgim577 created=1548000997197 accessed=1548000997197 lastaccessed=1548000997197 maxInactiveMs=10800000 expiry=1548011797197
    at org.eclipse.jetty.server.session.Session.checkValidForRead(Session.java:631)

When i change the connection on the Android device , switching to Airplane mode and witching back on, the error is gone.
I use the Pong action every 20 seconds to keep the connection alive.

Any help is highly appreciated.

Regards,
Philip
 

Philip Prins

Active Member
Licensed User
I get the error as mentioned, strange thing is that the chat shared function stops for all connected devices.
When the device in question looses internet and recoonects all works fine again.
 
Upvote 0
Top