B4J Question [SOLVED - BUGGY CHROME BUILD][ABMaterial] Mini Template behaving weirdly on Windows 10 Google Chrome

JackKirk

Well-Known Member
Licensed User
Longtime User
EDIT - SEE POST 4 FOR SOLUTION

I have installed

[ABMaterial/ABMServer] Mini Template for absolute beginners (update 2022/09/08)​

as per:

https://www.b4x.com/android/forum/t...ginners-update-2022-09-08.117237/#post-733213

If I run it in debug mode it works fine when I use the Microsoft Edge browser with the URL "http://localhost:51042/template", it also disconnects cleanly when I close the browser - see log below:
Waiting for debugger to connect...
Program started.
Start B4J Analyse!
When an error occurs, check the B4JAnalyse.log file in the Objects folder to see the last B4J line it was working on.
Collecting data from B4J source files... (1/2)
ABMCacheV3.bas
ABMPageTemplate.bas
Template.b4j
Analysing data from B4J source files... (2/2)
loading D:\Tree Tops\B4X\ABMMini\Template\Objects: copymewithjar.needs...
Using cache system: 3.0
Current App version: 1711245038656
Needs material/awesome icons
Building D:\Tree Tops\B4X\ABMMini\Template\Objects\copymewithjar.js.needs
Building core.min.1711245038656.css...
2024-03-24 12:50:38.964:INFO :eek:ejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 14.0.1+7
2024-03-24 12:50:39.030:INFO :eek:ejss.DefaultSessionIdManager:main: Session workerName=node0
2024-03-24 12:50:39.041:INFO :eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@639c2c1d{/,file:///D:/Tree%20Tops/B4X/ABMMini/Template/Objects/www/,AVAILABLE}
2024-03-24 12:50:39.048:INFO :eek:ejs.RequestLogWriter:main: Opened D:\Tree Tops\B4X\ABMMini\Template\Objects\logs\b4j-2024_03_24.request.log
2024-03-24 12:50:39.094:INFO :eek:ejs.AbstractConnector:main: Started ServerConnector@36b4cef0{HTTP/1.1, (http/1.1)}{0.0.0.0:51042}
2024-03-24 12:50:39.107:INFO :eek:ejs.Server:main: Started Server@2b4a2ec7{STARTING}[11.0.9,sto=0] @1063ms
Emulated network latency: 100ms
2024-03-24 12:50:39.109:INFO :eek:ejs.Server:main: Stopped Server@2b4a2ec7{STOPPING}[11.0.9,sto=0]
2024-03-24 12:50:39.114:INFO :eek:ejs.AbstractConnector:main: Stopped ServerConnector@36b4cef0{HTTP/1.1, (http/1.1)}{0.0.0.0:51042}
2024-03-24 12:50:39.117:INFO :eek:ejsh.ContextHandler:main: Stopped o.e.j.s.ServletContextHandler@639c2c1d{/,file:///D:/Tree%20Tops/B4X/ABMMini/Template/Objects/www/,STOPPED}
2024-03-24 12:50:39.121:INFO :eek:ejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 14.0.1+7
2024-03-24 12:50:39.124:INFO :eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@639c2c1d{/,file:///D:/Tree%20Tops/B4X/ABMMini/Template/Objects/www/,AVAILABLE}
2024-03-24 12:50:39.125:INFO :eek:ejs.RequestLogWriter:main: Opened D:\Tree Tops\B4X\ABMMini\Template\Objects\logs\b4j-2024_03_24.request.log
2024-03-24 12:50:39.125:INFO :eek:ejss.DefaultSessionIdManager:main: Session workerName=node0
2024-03-24 12:50:39.128:INFO :eek:ejs.AbstractConnector:main: Started ServerConnector@36b4cef0{HTTP/1.1, (http/1.1)}{0.0.0.0:51042}
2024-03-24 12:50:39.129:INFO :eek:ejs.Server:main: Started Server@2b4a2ec7{STARTING}[11.0.9,sto=0] @1086ms
Open with:
localhost:51042/template
null
null
Connected
Waiting for value (102 ms)
Waiting for value (101 ms)
Waiting for value (102 ms)
Disconnected
null
null
Connected
Waiting for value (103 ms)
Waiting for value (102 ms)
Waiting for value (102 ms)
Disconnected
null
null
Connected
Waiting for value (103 ms)
UpdateFromCache: ABMPageTemplate8a6d220f-6120-402b-8a4e-7abf7956f1d9
Saving the first instance
Waiting for value (101 ms)
Websocket first connection
Waiting for value (101 ms)
ABMPageTemplate8a6d220f-6120-402b-8a4e-7abf7956f1d9
null
null
preparing for url refresh
Disconnected
However if I run it in debug mode and use the Google Chrome browser (on the same PC) it goes into an endless loop, and issues a heap of "java.io.IOException: java.nio.channels.ClosedChannelException" errors when I close the browser - see log below:
Waiting for debugger to connect...
Program started.
Start B4J Analyse!
When an error occurs, check the B4JAnalyse.log file in the Objects folder to see the last B4J line it was working on.
Collecting data from B4J source files... (1/2)
ABMCacheV3.bas
ABMPageTemplate.bas
Template.b4j
Analysing data from B4J source files... (2/2)
loading D:\Tree Tops\B4X\ABMMini\Template\Objects: copymewithjar.needs...
Using cache system: 3.0
Current App version: 1711244873302
Needs material/awesome icons
Building D:\Tree Tops\B4X\ABMMini\Template\Objects\copymewithjar.js.needs
Building core.min.1711244873302.css...
2024-03-24 12:47:53.575:INFO :eek:ejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 14.0.1+7
2024-03-24 12:47:53.631:INFO :eek:ejss.DefaultSessionIdManager:main: Session workerName=node0
2024-03-24 12:47:53.641:INFO :eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@639c2c1d{/,file:///D:/Tree%20Tops/B4X/ABMMini/Template/Objects/www/,AVAILABLE}
2024-03-24 12:47:53.647:INFO :eek:ejs.RequestLogWriter:main: Opened D:\Tree Tops\B4X\ABMMini\Template\Objects\logs\b4j-2024_03_24.request.log
2024-03-24 12:47:53.689:INFO :eek:ejs.AbstractConnector:main: Started ServerConnector@36b4cef0{HTTP/1.1, (http/1.1)}{0.0.0.0:51042}
2024-03-24 12:47:53.699:INFO :eek:ejs.Server:main: Started Server@2b4a2ec7{STARTING}[11.0.9,sto=0] @982ms
Emulated network latency: 100ms
2024-03-24 12:47:53.702:INFO :eek:ejs.Server:main: Stopped Server@2b4a2ec7{STOPPING}[11.0.9,sto=0]
2024-03-24 12:47:53.707:INFO :eek:ejs.AbstractConnector:main: Stopped ServerConnector@36b4cef0{HTTP/1.1, (http/1.1)}{0.0.0.0:51042}
2024-03-24 12:47:53.709:INFO :eek:ejsh.ContextHandler:main: Stopped o.e.j.s.ServletContextHandler@639c2c1d{/,file:///D:/Tree%20Tops/B4X/ABMMini/Template/Objects/www/,STOPPED}
2024-03-24 12:47:53.713:INFO :eek:ejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 14.0.1+7
2024-03-24 12:47:53.715:INFO :eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@639c2c1d{/,file:///D:/Tree%20Tops/B4X/ABMMini/Template/Objects/www/,AVAILABLE}
2024-03-24 12:47:53.716:INFO :eek:ejs.RequestLogWriter:main: Opened D:\Tree Tops\B4X\ABMMini\Template\Objects\logs\b4j-2024_03_24.request.log
2024-03-24 12:47:53.716:INFO :eek:ejss.DefaultSessionIdManager:main: Session workerName=node0
2024-03-24 12:47:53.719:INFO :eek:ejs.AbstractConnector:main: Started ServerConnector@36b4cef0{HTTP/1.1, (http/1.1)}{0.0.0.0:51042}
2024-03-24 12:47:53.720:INFO :eek:ejs.Server:main: Started Server@2b4a2ec7{STARTING}[11.0.9,sto=0] @1002ms
Open with:
localhost:51042/template
null
null
Connected
Waiting for value (101 ms)
Waiting for value (101 ms)
Waiting for value (100 ms)
Disconnected
null
null
Connected
Waiting for value (114 ms)
Waiting for value (103 ms)
Waiting for value (100 ms)
Disconnected
null
null
Connected
Waiting for value (104 ms)
Waiting for value (101 ms)
Waiting for value (104 ms)
Disconnected
null
null
Connected
Waiting for value (113 ms)
Waiting for value (102 ms)
Waiting for value (101 ms)
Disconnected
null
null
Connected
Waiting for value (103 ms)
Waiting for value (101 ms)
Waiting for value (103 ms)
Disconnected
null
null
Connected
Waiting for value (102 ms)
Waiting for value (102 ms)
Waiting for value (101 ms)
Disconnected
null
null
Connected
Waiting for value (103 ms)
Waiting for value (101 ms)
Waiting for value (100 ms)
Disconnected
null
null
Connected
Waiting for value (101 ms)
Waiting for value (101 ms)
Waiting for value (101 ms)
Disconnected
null
null
Connected
Waiting for value (100 ms)
Waiting for value (101 ms)
Waiting for value (101 ms)
Disconnected
null
null
Connected
Waiting for value (107 ms)
Waiting for value (101 ms)
Waiting for value (101 ms)
Disconnected
null
null
Connected
Waiting for value (114 ms)
Waiting for value (103 ms)
Waiting for value (101 ms)
Disconnected
null
null
Connected
Waiting for value (101 ms)
Waiting for value (101 ms)
Waiting for value (102 ms)
Disconnected
null
null
Connected
Waiting for value (103 ms)
Waiting for value (100 ms)
Waiting for value (102 ms)
Disconnected
null
null
Connected
Waiting for value (100 ms)
java.io.IOException: java.nio.channels.ClosedChannelException
at org.eclipse.jetty.util.FutureCallback.block(FutureCallback.java:163)
at org.eclipse.jetty.websocket.common.JettyWebSocketRemoteEndpoint.flush(JettyWebSocketRemoteEndpoint.java:267)
at anywheresoftware.b4j.object.WebSocket.Flush(WebSocket.java:117)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:205)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:81)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:40)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at com.ab.template.main.main(main.java:29)
Caused by: java.nio.channels.ClosedChannelException
at org.eclipse.jetty.websocket.core.internal.FrameFlusher.enqueue(FrameFlusher.java:155)
at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.enqueueFrame(WebSocketConnection.java:639)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$OutgoingAdaptor.sendFrame(WebSocketCoreSession.java:723)
at org.eclipse.jetty.websocket.core.AbstractExtension.nextOutgoingFrame(AbstractExtension.java:150)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension.nextOutgoingFrame(PerMessageDeflateExtension.java:238)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension$OutgoingFlusher.deflate(PerMessageDeflateExtension.java:347)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension$OutgoingFlusher.transform(PerMessageDeflateExtension.java:281)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher$Flusher.process(TransformingFlusher.java:127)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:232)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:214)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher.sendFrame(TransformingFlusher.java:75)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension.sendFrame(PerMessageDeflateExtension.java:87)
at org.eclipse.jetty.websocket.core.internal.ExtensionStack.sendFrame(ExtensionStack.java:242)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$Flusher.forwardFrame(WebSocketCoreSession.java:814)
at org.eclipse.jetty.websocket.core.internal.FragmentingFlusher.onFrame(FragmentingFlusher.java:50)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher$Flusher.process(TransformingFlusher.java:120)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:232)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:214)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher.sendFrame(TransformingFlusher.java:75)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.flush(WebSocketCoreSession.java:549)
at org.eclipse.jetty.websocket.common.JettyWebSocketRemoteEndpoint.flush(JettyWebSocketRemoteEndpoint.java:266)
at anywheresoftware.b4j.object.WebSocket.Flush(WebSocket.java:117)
at anywheresoftware.b4j.object.WebSocket$SimpleFuture.getValue(WebSocket.java:73)
at com.ab.abmaterial.ABMPage.WebsocketReconnected(ABMPage.java:4609)
at com.ab.template.abmapplication._websocket_connected(abmapplication.java:549)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
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:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:204)
... 29 more
Disconnected
java.lang.NullPointerException
at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:142)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:81)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:40)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at com.ab.template.main.main(main.java:29)
java.io.IOException: java.nio.channels.ClosedChannelException
at org.eclipse.jetty.util.FutureCallback.block(FutureCallback.java:163)
at org.eclipse.jetty.websocket.common.JettyWebSocketRemoteEndpoint.flush(JettyWebSocketRemoteEndpoint.java:267)
at anywheresoftware.b4j.object.WebSocket.Flush(WebSocket.java:117)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:147)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:81)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:40)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at com.ab.template.main.main(main.java:29)
Caused by: java.nio.channels.ClosedChannelException
at org.eclipse.jetty.websocket.core.internal.FrameFlusher.enqueue(FrameFlusher.java:155)
at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.enqueueFrame(WebSocketConnection.java:639)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$OutgoingAdaptor.sendFrame(WebSocketCoreSession.java:723)
at org.eclipse.jetty.websocket.core.AbstractExtension.nextOutgoingFrame(AbstractExtension.java:150)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension.nextOutgoingFrame(PerMessageDeflateExtension.java:238)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension$OutgoingFlusher.deflate(PerMessageDeflateExtension.java:347)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension$OutgoingFlusher.transform(PerMessageDeflateExtension.java:281)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher$Flusher.process(TransformingFlusher.java:127)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:232)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:214)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher.sendFrame(TransformingFlusher.java:75)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension.sendFrame(PerMessageDeflateExtension.java:87)
at org.eclipse.jetty.websocket.core.internal.ExtensionStack.sendFrame(ExtensionStack.java:242)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$Flusher.forwardFrame(WebSocketCoreSession.java:814)
at org.eclipse.jetty.websocket.core.internal.FragmentingFlusher.onFrame(FragmentingFlusher.java:50)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher$Flusher.process(TransformingFlusher.java:120)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:232)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:214)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher.sendFrame(TransformingFlusher.java:75)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.flush(WebSocketCoreSession.java:549)
at org.eclipse.jetty.websocket.common.JettyWebSocketRemoteEndpoint.flush(JettyWebSocketRemoteEndpoint.java:266)
at anywheresoftware.b4j.object.WebSocket.Flush(WebSocket.java:117)
at anywheresoftware.b4j.object.WebSocket$SimpleFuture.getValue(WebSocket.java:73)
at com.ab.abmaterial.ABMPage.WebsocketReconnected(ABMPage.java:4609)
at com.ab.template.abmapplication._websocket_connected(abmapplication.java:549)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
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:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:204)
... 29 more
java.lang.NullPointerException
at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:142)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:81)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:40)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at com.ab.template.main.main(main.java:29)
java.io.IOException: java.nio.channels.ClosedChannelException
at org.eclipse.jetty.util.FutureCallback.block(FutureCallback.java:163)
at org.eclipse.jetty.websocket.common.JettyWebSocketRemoteEndpoint.flush(JettyWebSocketRemoteEndpoint.java:267)
at anywheresoftware.b4j.object.WebSocket.Flush(WebSocket.java:117)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:147)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:81)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:40)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.shell.ShellBA.startMessageLoop(ShellBA.java:121)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:309)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at com.ab.template.main.main(main.java:29)
Caused by: java.nio.channels.ClosedChannelException
at org.eclipse.jetty.websocket.core.internal.FrameFlusher.enqueue(FrameFlusher.java:155)
at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.enqueueFrame(WebSocketConnection.java:639)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$OutgoingAdaptor.sendFrame(WebSocketCoreSession.java:723)
at org.eclipse.jetty.websocket.core.AbstractExtension.nextOutgoingFrame(AbstractExtension.java:150)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension.nextOutgoingFrame(PerMessageDeflateExtension.java:238)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension$OutgoingFlusher.deflate(PerMessageDeflateExtension.java:347)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension$OutgoingFlusher.transform(PerMessageDeflateExtension.java:281)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher$Flusher.process(TransformingFlusher.java:127)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:232)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:214)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher.sendFrame(TransformingFlusher.java:75)
at org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension.sendFrame(PerMessageDeflateExtension.java:87)
at org.eclipse.jetty.websocket.core.internal.ExtensionStack.sendFrame(ExtensionStack.java:242)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$Flusher.forwardFrame(WebSocketCoreSession.java:814)
at org.eclipse.jetty.websocket.core.internal.FragmentingFlusher.onFrame(FragmentingFlusher.java:50)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher$Flusher.process(TransformingFlusher.java:120)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:232)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:214)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher.sendFrame(TransformingFlusher.java:75)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.flush(WebSocketCoreSession.java:549)
at org.eclipse.jetty.websocket.common.JettyWebSocketRemoteEndpoint.flush(JettyWebSocketRemoteEndpoint.java:266)
at anywheresoftware.b4j.object.WebSocket.Flush(WebSocket.java:117)
at anywheresoftware.b4j.object.WebSocket$SimpleFuture.getValue(WebSocket.java:73)
at com.ab.abmaterial.ABMPage.WebsocketReconnected(ABMPage.java:4609)
at com.ab.template.abmapplication._websocket_connected(abmapplication.java:549)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
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:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:204)
... 29 more
I have tried uninstalling/reinstalling Chrome but it made no difference.

I would really like to consider using ABMaterial but this seems to be a big speed hump.

Any suggestions welcome...
 
Last edited:

JackKirk

Well-Known Member
Licensed User
Longtime User
I downloaded the Firefox browser and it works fine also.

I'm ripping what little hair I have left trying to work out why Chrome isn't working - googled myself silly (on Chrome) but nothing fixes it.

Helpppppp...
 
Last edited:
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Digging deeper, I used 7zip to break the classes out of ABMServer.b4xlib, and copied them to ...\ABMMini\Template

I launched ...\ABMMini\Template\Template.b4j then unchecked ABMServer in [Libraries Manager] then made the ABMServer.b4xlib classes available via [Project>Add Existing Modules]

This enabled me to pause ABMApplication in WebSocket_Connected after the statement

Main.server.NavigateToPage(ws, "","./" & InitialPage)

see following:
B4X:
Private Sub WebSocket_Connected (WebSocket1 As WebSocket)   
    Log("Connected")
    ws = WebSocket1

    ABMPageId = ABM.GetPageID(AppPage, Main.server.AppName,ws)
    '----------------------START MODIFICATION 4.00-------------------------------

    If AppPage.WebsocketReconnected Then

        Main.server.NavigateToPage(ws, "", "./")

        Return
    End If

    Dim session As HttpSession = ABM.GetSession(ws, Main.server.SessionMaxInactiveIntervalSeconds) 'ignore
    If session.IsNew Then
        session.Invalidate
        Main.server.NavigateToPage(ws, "", "./")
        Return
    End If
    '----------------------END MODIFICATION 4.00-------------------------------

    ' Prepare the page IMPORTANT!
    AppPage.Prepare   

    ' Run ConnectPage here in ABMApplication
    ConnectPage   


    ' navigate to the first page
    If Main.server.NeedsAuthorization Then
        If session.GetAttribute2("IsAuthorized", "") = "" Then
            AppPage.ShowModalSheet("login")
            Return
        End If
    End If

    Main.server.NavigateToPage(ws, "","./" & InitialPage)
Log(1)    '<<<<<<<<<<pause here
End Sub

I run this in debug mode and launch Chrome in the same PC and give a URL of "localhost:51042/template"

I then let it go thru the "Log(1)" pause several times

While in this paused state - in the Chrome browser I tap the 3 dots in upper right then [More Tools] then [Developer Tools] then [Console] I find entries of the form:

No WebSocket Open ... core.4.97.min.js:45

When I tap on [core.4.97.min.js:45] it opens a window in the [Sources] tab which shows:
B4X:
function b4j_raiseEvent(e, t) {
    if (b4j_ws) {
        document.getElementById("pageconnectedindicator");
        if (b4j_ws.readyState == 3) {
            console.log("No WebSocket Open");
            window.name= "";
            b4j_ws.close();
            location.reload();
            
            //b4j_connect(currentE, e, t);   
            return;
        }
        try {
            1 !== b4j_ws.readyState ? !1 === b4j_closeMessage && ("undefined" == typeof RobustWebSocket ? window.console.error("Server is currently not available.") : window.console.error("Connection is closed. Trying to reconnect."), b4j_closeMessage = !0) : (b4j_closeMessage = !1, b4j_ws.send(JSON.stringify({
                type: "event",
                event: e,
                params: t
            })))
        } catch (e) {
            console.log(e);
        }
    } else {
        console.log("b4j_ws: " + b4j_ws);
    }
}
and points to the statement [console.log("No WebSocket Open");]

I am well and truly out of my paygrade with this....
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
I FOUND THE PROBLEM!!!!

I had to take a step back and let this stew for a while.

It was obvious that the problem was Windows Chrome specific.

I started exploring Windows Chrome releases and found this site:

https://google-chrome.en.uptodown.com/windows/versions

I was on 123.0.6312.59 - released on March 20 2024

Then the penny dropped - this was about the time I started having problems.

Another clue which I didn't consider relevant until now was that I had this all working earlier but just assumed I had stuffed something in Chrome with all the fiddling I was doing.

So I downgraded Chrome to 122.0.6261.128 - released on March 15 2024

And turned automatic Chrome updating off.

And everything works.

THE PROBLEM IS A BUGGY CHROME BUILD

Just to double check I reinstalled Chrome 123.0.6312.59 again - and with no other changes the problem returned.

Judging by the site pointed to earlier in this post it appears that Chrome updates are happening on an approximately weekly basis - and by that timetable another build is imminent. When it happens I will test it and report back here.
 
Last edited:
Upvote 0
Top