jetty 9: java.nio.channels.WritePendingException on WebSocket.connect over SSL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

jetty 9: java.nio.channels.WritePendingException on WebSocket.connect over SSL

johnnysmoke
This post has NOT been accepted by the mailing list yet.
Hi,

Anybody has encountered this error with Jetty 9 RC0 websocket client? I get an WritePendingException when I call connect on a WebSocket object using the wss:// scheme. Https seems to be working fine as well as WebSocket. If I replace the URI with "ws://" it work fine....

thanks,

<code>

SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStorePath("c:/appz/jetty/etc/keystore");
sslContextFactory.setKeyStorePassword("storepwd");
sslContextFactory.setKeyManagerPassword("keypwd");

WebSocketClient client = new WebSocketClient(sslContextFactory);
WSocketClient sock = new WSocketClient("body", 5000, inK);  // @WebSocket class
       
client.start();
URI theURI = UriBuilder.fromUri("wss://localhost:8443/Test/ws").build();
client.connect(sock, theURI);   /// <- faulty line, exception  thrown here

</code>


stack trace:

java.nio.channels.WritePendingException
        at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:292)
        at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:124)
        at org.eclipse.jetty.websocket.client.io.UpgradeConnection$SendUpgradeRequest.run(UpgradeConnection.java:65)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:589)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:520)
        at java.lang.Thread.run(Thread.java:722)

Reply | Threaded
Open this post in threaded view
|

Re: jetty 9: java.nio.channels.WritePendingException on WebSocket.connect over SSL

ghetolay
I had this warning but turns out error wasn't related to that.
When I switch to TRACE log I noticed I had an error about ssl handshake.

In my case it's because I change my jre from 1.6 to 1.7 because of jetty 9. On 1.7 oracle is more strict about TLS handshake.

Now that I solve this problem I still get this same warning but looks like everything works fine.