B4J Question [abmaterial] Is it jserver's bug?,I'm not sure.

liulifeng77

Active Member
Licensed User
Longtime User
if I browse a few pages on the browser, quickly click the back button two or three times , the server will be stuck few seconds and then throws out the wrong information。if many users clicked the back button at the same time, server will collapse.
it confused me for a month.how to solve it.
thanks very much.
log ------------------------------------------------------log
Waiting for debugger to connect...
Program started.
涓夋湀 28, 2018 1:03:44 涓嬪崍 com.mchange.v2.log.MLog
淇℃伅: MLog clients using java 1.4+ standard logging.
涓夋湀 28, 2018 1:03:44 涓嬪崍 com.mchange.v2.c3p0.C3P0Registry
淇℃伅: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
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)
ABMShared.bas
sharemsg.bas
ABMCacheControl.bas
ABMErrorHandler.bas
ABMUploadHandler.bas
download.bas
FacebookPost.bas
uploadfile.bas
ABMCacheScavenger.bas
LikeComponent.bas
qrcode.bas
MashCameraPlain.bas
ABMApplication.bas
remote.bas
forum.bas
askfor.bas
exam.bas
muti_choice.bas
audio_test.bas
admin_member.bas
book_upload.bas
movie.bas
zuoye_centre.bas
cj_info.bas
login_ad.bas
excel_upload.bas
pwdreset.bas
msg_centre.bas
push.bas
pigai.bas
pubexam.bas
buildexam.bas
tongzhi.bas
test_input.bas
TestPage.bas
kj_upload.bas
zy_info.bas
FrappeChart.bas
test.bas
teacher.bas
anli_input.bas
kq_info.bas
kejian.bas
sz.b4j
Analysing data from B4J source files... (2/2)
Loading icons for FileManager
loading H:\LEARNA~1.25)\sz\Objects: copymewithjar.needs...
Using cache system: 3.0
Needs material/awesome icons
涓夋湀 28, 2018 1:03:47 涓嬪崍 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource
淇℃伅: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 20000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1br16c19utop3xus0kxax|6979e8cb, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> net.sourceforge.jtds.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1br16c19utop3xus0kxax|6979e8cb, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:jtds:sqlserver://localhost:1433;Instance Name=LIUSQL;database=liusql, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, ma...
Building H:\LEARNA~1.25)\sz\Objects\copymewithjar.js.needs
Building core.min.1522213423917.css...
2018-03-28 13:03:48.161:INFO::main: Logging initialized @4887ms to org.eclipse.jetty.util.log.StdErrLog
2018-03-28 13:03:48.275:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT
2018-03-28 13:03:48.311:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0
2018-03-28 13:03:48.311:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2018-03-28 13:03:48.313:INFO:eek:ejs.session:main: Scavenging every 660000ms
2018-03-28 13:03:48.351:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@353d0772{/,file:///H:/learn%20app(4.25)/sz/Objects/www/,AVAILABLE}
2018-03-28 13:03:48.360:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened H:\learn app(4.25)\sz\Objects\logs\b4j-2018_03_28.request.log
2018-03-28 13:03:48.385:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@c33b74f{HTTP/1.1,[http/1.1]}{0.0.0.0:51041}
2018-03-28 13:03:48.385:INFO:eek:ejs.Server:main: Started @5112ms
Emulated network latency: 100ms
2018-03-28 13:03:48.396:INFO:eek:ejs.AbstractConnector:main: Stopped ServerConnector@c33b74f{HTTP/1.1,[http/1.1]}{0.0.0.0:51041}
2018-03-28 13:03:48.396:INFO:eek:ejs.session:main: Stopped scavenging
2018-03-28 13:03:48.399:INFO:eek:ejsh.ContextHandler:main: Stopped o.e.j.s.ServletContextHandler@353d0772{/,file:///H:/learn%20app(4.25)/sz/Objects/www/,UNAVAILABLE}
2018-03-28 13:03:48.403:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT
2018-03-28 13:03:48.419:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@353d0772{/,file:///H:/learn%20app(4.25)/sz/Objects/www/,AVAILABLE}
2018-03-28 13:03:48.419:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened H:\learn app(4.25)\sz\Objects\logs\b4j-2018_03_28.request.log
2018-03-28 13:03:48.419:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0
2018-03-28 13:03:48.419:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2018-03-28 13:03:48.419:INFO:eek:ejs.session:main: Scavenging every 600000ms
2018-03-28 13:03:48.427:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@c33b74f{HTTP/1.1,[http/1.1]}{0.0.0.0:51041}
2018-03-28 13:03:48.428:INFO:eek:ejs.Server:main: Started @5154ms
2018-03-28 13:03:48.428:INFO:eek:ejs.session:main: Scavenging every 660000ms
askfor_Connected
Waiting for value (101 ms)
2018-03-28 13:03:49.481:INFO:eek:ejs.session:main: Session node0zewm0k8fzwkyshpxvn1trerb0 already being invalidated
java.lang.IllegalStateException: Not valid for write: id=node0zewm0k8fzwkyshpxvn1trerb0 created=1522213429310 accessed=1522213429310 lastaccessed=1522213429310 maxInactiveMs=7200000 expiry=1522220629480
askfor_Connected
Waiting for value (100 ms)
askfor_preparing for url refresh
Waiting for value (100 ms)
Waiting for value (101 ms)
Users browser language: ch
Waiting for value (101 ms)
kejian_pageConnected
Waiting for value (127 ms)
2018-03-28 13:03:53.019:INFO:eek:ejs.session:main: Session node01eeqh092mhlori4lpkz7jnt6g2 already being invalidated
kejian_Disconnected
java.lang.IllegalStateException: Not valid for write: id=node01eeqh092mhlori4lpkz7jnt6g2 created=1522213432878 accessed=1522213432878 lastaccessed=1522213432878 maxInactiveMs=7200000 expiry=1522220633018
/favicon.ico
Not Found
Waiting for value (101 ms)
application_preparing for url refresh
applicationDisconnected
login_ad_pageConnected
Waiting for value (134 ms)
Saving the first instance
Waiting for value (100 ms)
login_ad_Websocket first connection
true
Waiting for value (101 ms)
NativePlatform:
This webapp is not running as a native app!
Waiting for value (100 ms)
Mozilla/5.0 (Linux; Android 6.0.1; SM919 Build/MXB48T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.97 Mobile Safari/537.36
long-41308
map.size0
login_ad_preparing for url refresh
login_ad_Disconnected
kejian_pageConnected
Waiting for value (109 ms)
Saving the first instance
Waiting for value (100 ms)
kejian_Websocket first connection
Waiting for value (101 ms)
Waiting for value (121 ms)
conn
2
Waiting for value (101 ms)
kejian_Disconnected
zuoye_centre_Connected
Waiting for value (136 ms)
Saving the first instance
Waiting for value (134 ms)
zuoye_centre_Websocket first connection
Waiting for value (158 ms)
Waiting for value (157 ms)
zuoye_centre_preparing for url refresh
zuoye_centre-Disconnected
需要删除碎片文件数9
test_pageConnected
Waiting for value (127 ms)
Saving the first instance
Waiting for value (100 ms)
test_page_Websocket first connection
Waiting for value (257 ms)
Waiting for value (101 ms)
testPage_preparing for url refresh
test_pageDisconnected
forum_Connected
Waiting for value (101 ms)
Saving the first instance
Waiting for value (101 ms)
forum_Websocket first connection
Waiting for value (100 ms)
Waiting for value (134 ms)
Waiting for value (101 ms)
Waiting for value (184 ms)
Waiting for value (289 ms)
Waiting for value (614 ms)
Error occurred on line: 373 (forum)-------------->code:page.cell(1,2).refresh

java.lang.RuntimeException: org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
at anywheresoftware.b4j.object.WebSocket.get(WebSocket.java:120)
at anywheresoftware.b4j.object.WebSocket.EvalWithResult(WebSocket.java:330)
at com.ab.abmaterial.ABMCell.RefreshInternalExtra(Unknown Source)
at com.ab.abmaterial.ABMCell.Refresh(Unknown Source)
at b4j.example.forum._addnewcard(forum.java:241)
at b4j.example.forum._connectpage(forum.java:1098)
at b4j.example.forum._websocket_connected(forum.java:2437)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:613)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:231)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.GeneratedMethodAccessor3.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:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:188)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:114)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:148)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:303)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:65)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:21)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:114)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:148)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:303)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at b4j.example.main.main(main.java:29)
Caused by: org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
at org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSocketSession.java:310)
at anywheresoftware.b4j.object.WebSocket.sendText(WebSocket.java:107)
at anywheresoftware.b4j.object.WebSocket.get(WebSocket.java:117)
... 49 more
org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
at org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSocketSession.java:310)
at anywheresoftware.b4j.object.WebSocket.Flush(WebSocket.java:101)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:189)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:114)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:148)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:303)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:65)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:21)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:114)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:148)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:303)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at b4j.example.main.main(main.java:29)
_forum_Disconnected
java.lang.NullPointerException
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.b4a.ShellBA.startMessageLoop(ShellBA.java:114)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:148)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:303)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:65)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:21)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:114)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:148)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:303)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at b4j.example.main.main(main.java:29)
Error occurred on line: 95 (ABMCacheControl)
org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
at org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSocketSession.java:310)
at anywheresoftware.b4j.object.WebSocket.Flush(WebSocket.java:101)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:131)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:114)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:148)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:303)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:65)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:21)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:114)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:148)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:303)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at b4j.example.main.main(main.java:29)
 
Last edited:

mindful

Active Member
Licensed User
You are calling page.cell().refresh while the websocket is not open anymore ... how are you calling this refresh ? Inside a timer? Is this log from when running in debug mode ? If so try running in release because in debug all the code runs on the main thread ...

And also use code tags as it's easier to follow your log..... anyway this kind of error shoukd be ignored but you should cleanup all websocket resources (timers) at websocket_disconnected
 
Upvote 0

liulifeng77

Active Member
Licensed User
Longtime User
I test the demo( click the back button on the browser quickly continuously) then get the follow error message:
B4X:
Waiting for value (3 ms)
Saving the first instance
Waiting for value (1 ms)
Websocket first connection
Waiting for value (11 ms)
Waiting for value (2 ms)
AboutPage9a0ca39b-d849-4321-a8dd-4e1a16a8279e
Waiting for value (61 ms)
Asia/Shanghai
Saving the first instance
java.lang.RuntimeException: java.lang.RuntimeException: org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:119)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:188)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
    at anywheresoftware.b4j.object.WebSocket.get(WebSocket.java:120)
    at anywheresoftware.b4j.object.WebSocket.RunFunctionWithResult(WebSocket.java:308)
    at com.ab.abmaterial.ABMPage.WebsocketReconnected(Unknown Source)
    at abmaterial.ab.com.compactionbuttonpage._websocket_connected(compactionbuttonpage.java:543)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
    ... 7 more
Caused by: org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
    at org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSocketSession.java:310)
    at anywheresoftware.b4j.object.WebSocket.sendText(WebSocket.java:107)
    at anywheresoftware.b4j.object.WebSocket.get(WebSocket.java:117)
    ... 15 more
Disconnected
 
Upvote 0

mindful

Active Member
Licensed User
This error is normal ... it's because it want's to do something while the websocket it's closed (you pressed the back button). You can ingnore this error. Also your problem was the the server was slowing down and this error has nothing to do with that in release mode, because it is raised on another thread.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Nothing much I nor Erel can do about this. Erel said one can ignore these errors.

We always disable the back button in our production Webapps: Page.DisableBackButton = true in BuildPage.
Actually for most of our production webapps we make a Chrome shortcut to the users desktop so the back button doesn't even exist :D

upload_2018-3-28_13-38-59.png


A simple search for RemoteEndpoint unavailable in this forum shows a lot of times this happens. Some can be solved, some not but you will have to go through them to find out if their case fits your case. E.g. in one case it was because a utf-8/ISO character in a path folder...

You could always have a look into loadbalancers, upgrading your server (RAM?) etc if this bothers you.
 
Last edited:
Upvote 0
Top