I get the following error message if i try to connect to "wss://b4x.com:51041/smiley/ws"
I have already found several threads with this problem, but without working solutions.
I'm using this code:
B4J Version: 10 Beta #2
jWebSocketClient Version: 1.13
Java Version: 11
B4X:
Waiting for debugger to connect...
Program started.
2023-10-11 09:54:11.167:INFO::JavaFX Application Thread: Logging initialized @3000ms to org.eclipse.jetty.util.log.StdErrLog
org.eclipse.jetty.websocket.api.UpgradeException: 0 null
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:515)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:464)
at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:545)
at org.eclipse.jetty.client.HttpReceiver.responseFailure(HttpReceiver.java:436)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.failAndClose(HttpReceiverOverHTTP.java:369)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.earlyEOF(HttpReceiverOverHTTP.java:338)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1476)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.shutdown(HttpReceiverOverHTTP.java:209)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:147)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:155)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ssl.SslConnection$2.run(SslConnection.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:760)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:678)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.EOFException: HttpConnectionOverHTTP@7a0e862d(l:/192.168.188.20:54622 <-> r:b4x.com/67.227.218.133:51041,closed=false)=>HttpChannelOverHTTP@edccf14(exchange=HttpExchange@21053c9d req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@75f3a03b(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@5bc0994c{s=START}],recv=HttpReceiverOverHTTP@330c594f(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]<-DecryptedEndPoint@5d3de879{b4x.com/67.227.218.133:51041<->/192.168.188.20:54622,OPEN,fill=-,flush=-,to=4/0}->HttpConnectionOverHTTP@7a0e862d(l:/192.168.188.20:54622 <-> r:b4x.com/67.227.218.133:51041,closed=false)=>HttpChannelOverHTTP@edccf14(exchange=HttpExchange@21053c9d req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@75f3a03b(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@5bc0994c{s=START}],recv=HttpReceiverOverHTTP@330c594f(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]->SocketChannelEndPoint@4d9b97eb{b4x.com/67.227.218.133:51041<->/192.168.188.20:54622,ISHUT,fill=-,flush=-,to=4/0}{io=0/0,kio=0,kro=1}->SslConnection@61f26ca7{NEED_WRAP,eio=-1/-1,di=-1}=>HttpConnectionOverHTTP@7a0e862d(l:/192.168.188.20:54622 <-> r:b4x.com/67.227.218.133:51041,closed=false)=>HttpChannelOverHTTP@edccf14(exchange=HttpExchange@21053c9d req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@75f3a03b(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@5bc0994c{s=START}],recv=HttpReceiverOverHTTP@330c594f(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]
... 13 more
org.eclipse.jetty.websocket.api.UpgradeException: 0 null
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:522)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:464)
at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:545)
at org.eclipse.jetty.client.HttpReceiver.responseFailure(HttpReceiver.java:436)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.failAndClose(HttpReceiverOverHTTP.java:369)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.earlyEOF(HttpReceiverOverHTTP.java:338)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1476)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.shutdown(HttpReceiverOverHTTP.java:209)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:147)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:155)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ssl.SslConnection$2.run(SslConnection.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:760)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:678)
at java.base/java.lang.Thread.run(Thread.java:834)
java.util.concurrent.ExecutionException: org.eclipse.jetty.websocket.api.UpgradeException: 0 null
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at anywhersoftware.b4j.objects.WebSocketClientWrapper.Close(WebSocketClientWrapper.java:102)
at anywhersoftware.b4j.objects.WebSocketClientWrapper$WSHandler.onWebSocketError(WebSocketClientWrapper.java:163)
at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onError(JettyListenerEventDriver.java:112)
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingError(AbstractEventDriver.java:96)
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.handleException(WebSocketUpgradeRequest.java:528)
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:522)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:464)
at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:545)
at org.eclipse.jetty.client.HttpReceiver.responseFailure(HttpReceiver.java:436)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.failAndClose(HttpReceiverOverHTTP.java:369)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.earlyEOF(HttpReceiverOverHTTP.java:338)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1476)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.shutdown(HttpReceiverOverHTTP.java:209)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:147)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:155)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ssl.SslConnection$2.run(SslConnection.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:760)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:678)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.eclipse.jetty.websocket.api.UpgradeException: 0 null
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:515)
... 19 more
Caused by: java.io.EOFException: HttpConnectionOverHTTP@7a0e862d(l:/192.168.188.20:54622 <-> r:b4x.com/67.227.218.133:51041,closed=false)=>HttpChannelOverHTTP@edccf14(exchange=HttpExchange@21053c9d req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@75f3a03b(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@5bc0994c{s=START}],recv=HttpReceiverOverHTTP@330c594f(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]<-DecryptedEndPoint@5d3de879{b4x.com/67.227.218.133:51041<->/192.168.188.20:54622,OPEN,fill=-,flush=-,to=4/0}->HttpConnectionOverHTTP@7a0e862d(l:/192.168.188.20:54622 <-> r:b4x.com/67.227.218.133:51041,closed=false)=>HttpChannelOverHTTP@edccf14(exchange=HttpExchange@21053c9d req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@75f3a03b(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@5bc0994c{s=START}],recv=HttpReceiverOverHTTP@330c594f(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]->SocketChannelEndPoint@4d9b97eb{b4x.com/67.227.218.133:51041<->/192.168.188.20:54622,ISHUT,fill=-,flush=-,to=4/0}{io=0/0,kio=0,kro=1}->SslConnection@61f26ca7{NEED_WRAP,eio=-1/-1,di=-1}=>HttpConnectionOverHTTP@7a0e862d(l:/192.168.188.20:54622 <-> r:b4x.com/67.227.218.133:51041,closed=false)=>HttpChannelOverHTTP@edccf14(exchange=HttpExchange@21053c9d req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@75f3a03b(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@5bc0994c{s=START}],recv=HttpReceiverOverHTTP@330c594f(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]
... 13 more
Web socket client SSL can't connect
I have a program that works fine with non secure link to server. When I try to connect to wss link the connection process lasts about 1 minute and then throws following: org.eclipse.jetty.websocket.api.UpgradeException: 0 null .... '''''''''''''''''''' ''''''''''''''''''' WebSocket Closed: 0...
www.b4x.com
websocket error
Hello, I have a jar file created with b4j to connect to a remote server via websocket and get live updates of a price of stg. My jar randomlu crashes with this : Error:(ExecutionException) java.util.concurrent.ExecutionException: org.eclipse.jetty.websocket.api.UpgradeException: 0 null...
www.b4x.com
Secure websocket connection won't connect at first attempt
Hello everyone. I'm having a problem getting a secure websocket connection (B4J client to B4J server) to connect consistently.... Based on the various examples in the forum, I've merged the Websocket Push framework with the SQLite version of jRDC2 created by @OliverA, and created a client B4J...
www.b4x.com
Why Doesn't This Websocket Connect?
I think this should connect. I've tested the URL with an online websocket connection tester, and the connection works there. Private Sub StartWebsocket wsc.Initialize("wsc") wsc.Connect("wss://ws-feed.exchange.coinbase.com") Wait For wsc_Connected Log("Websocket connected!")...
www.b4x.com
I'm using this code:
B4X:
Dim ws As WebSocketClient
ws.Initialize("ws")
Dim ssl As JavaObject
ssl.InitializeNewInstance("org.eclipse.jetty.util.ssl.SslContextFactory", Array(True))
Dim jo As JavaObject = ws
Dim wsc As JavaObject
wsc.InitializeNewInstance("org.eclipse.jetty.websocket.client.WebSocketClient", Array(ssl))
jo.SetField("wsc", wsc)
Sleep(1000)
ws.Connect("wss://b4x.com:51041/smiley/ws")
Wait For ws_Connected
Log("connected")
jWebSocketClient Version: 1.13
Java Version: 11