Bug? jServer with wws (securewebsocket) connection

woniol

Active Member
Licensed User
Longtime User
It seem like there is a problem with wws connection to jServer.
I tried it with jWebSocketClient and new port of Android Autobahn with secure connection from 'deamon':
http://www.b4x.com/android/forum/threads/securewebsocket-client-library.45981/

While using it with standard jWebSocketClient i get:
WebSocket Closed: Cannot init SSL
in logs

While using with Android client i get:
internal error (java.lang.NullPointerException)

It connects fine to service like: wss://echo.websocket.org

I use it with these examples:
http://www.b4x.com/android/forum/threads/websocket-client-library.40221/

And my server config looks like this:
B4X:
srvr.Initialize("")
srvr.Port = 444
srvr.AddWebSocket("/ws", "B4A")
   
Dim ssl As SslConfiguration
ssl.Initialize
   ssl.SetKeyStorePath(File.DirApp, "keystore") 'path to keystore file
ssl.KeyStorePassword = "123456"
ssl.KeyManagerPassword = "123456"
srvr.SetSslConfiguration(ssl, 443)
Log(srvr.SslPort)
srvr.Start
 

woniol

Active Member
Licensed User
Longtime User
Server Logs:
B4X:
2014-10-25 08:48:47.578:INFO::main: Logging initialized @62ms
2014-10-25 08:48:47.813:INFO:oejs.Server:main: jetty-9.1.z-SNAPSHOT
2014-10-25 08:48:47.829:WARN:oejh.MimeTypes:main: java.util.MissingResourceException: Can't find bundle for base name org/eclipse/jetty/http/encoding, locale pl_PL
2014-10-25 08:48:47.860:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@d73c52f{/,file:/C:/Priv/B4J/B4A-WebSocket/Objects/www,AVAILABLE}
2014-10-25 08:48:47.860:INFO:oejs.AbstractNCSARequestLog:main: Opened C:\Priv\B4J\B4A-WebSocket\Objects\logs\b4j-2014_10_25.request.log
2014-10-25 08:48:47.875:INFO:oejs.ServerConnector:main: Started ServerConnector@1d9a43d7{HTTP/1.1}{0.0.0.0:444}
2014-10-25 08:48:48.960:INFO:oejs.ServerConnector:main: Started ServerConnector@1824c6ab{SSL-http/1.1}{0.0.0.0:443}
2014-10-25 08:48:48.960:INFO:oejs.Server:main: Started @1475ms

Client Logs:
B4X:
Program started.
2014-10-25 08:49:07.012:INFO::JavaFX Application Thread: Logging initialized @2868ms
java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
java.util.concurrent.ExecutionException: java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:123)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper.Close(WebSocketClientWrapper.java:76)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper$WSHandler.onWebSocketError(WebSocketClientWrapper.java:118)
    at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onError(JettyListenerEventDriver.java:92)
    at org.eclipse.jetty.websocket.client.io.ConnectPromise.failed(ConnectPromise.java:54)
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.connectionFailed(WebSocketClientSelectorManager.java:59)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector$Connect.failed(SelectorManager.java:864)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:622)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    ... 7 more
WebSocket Closed: Cannot init SSL
java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
WebSocket Closed: Cannot init SSL
java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
java.util.concurrent.ExecutionException: java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:123)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper.Close(WebSocketClientWrapper.java:76)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper$WSHandler.onWebSocketError(WebSocketClientWrapper.java:118)
    at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onError(JettyListenerEventDriver.java:92)
    at org.eclipse.jetty.websocket.client.io.ConnectPromise.failed(ConnectPromise.java:54)
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.connectionFailed(WebSocketClientSelectorManager.java:59)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector$Connect.failed(SelectorManager.java:864)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:622)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    ... 7 more
java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
WebSocket Closed: Cannot init SSL
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
java.util.concurrent.ExecutionException: java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:123)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper.Close(WebSocketClientWrapper.java:76)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper$WSHandler.onWebSocketError(WebSocketClientWrapper.java:118)
    at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onError(JettyListenerEventDriver.java:92)
    at org.eclipse.jetty.websocket.client.io.ConnectPromise.failed(ConnectPromise.java:54)
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.connectionFailed(WebSocketClientSelectorManager.java:59)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector$Connect.failed(SelectorManager.java:864)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:622)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    ... 7 more
java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
WebSocket Closed: Cannot init SSL
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
java.util.concurrent.ExecutionException: java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:123)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper.Close(WebSocketClientWrapper.java:76)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper$WSHandler.onWebSocketError(WebSocketClientWrapper.java:118)
    at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onError(JettyListenerEventDriver.java:92)
    at org.eclipse.jetty.websocket.client.io.ConnectPromise.failed(ConnectPromise.java:54)
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.connectionFailed(WebSocketClientSelectorManager.java:59)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector$Connect.failed(SelectorManager.java:864)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:622)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processKey(SelectorManager.java:576)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:543)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:485)
    at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$1.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Cannot init SSL
    at org.eclipse.jetty.websocket.client.io.WebSocketClientSelectorManager.newConnection(WebSocketClientSelectorManager.java:95)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:671)
    at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processConnect(SelectorManager.java:612)
    ... 7 more
 

woniol

Active Member
Licensed User
Longtime User
Ok, could You add wss support in WebSocketClient?
Just add it to the Wishlist as you are busy with b4i , I suppose. :)


I get:
WSHEnandler: WebSockets internal error (java.lang.NullPointerException)
Disconnected from WS server: WebSockets internal error (java.lang.NullPointerException)


the:
WebSockets internal error (java.lang.NullPointerException)
comes form ws_Closed event

I think deamon should add some more info to his lib as you asked him.
 
Top