Uploaded image for project: 'XNIO'
  1. XNIO
  2. XNIO-222

java.io.IOException: For now upgrade responses must have a content length of zero.

    XMLWordPrintable

    Details

      Description

      This code:

      final WebSocketContainer container = ContainerProvider.getWebSocketContainer();
      final URI securedEndpointURL = new URI("ws://echo.websocket.org:80"); // hrm, I really have to specify a port here ?
      
      container.connectToServer(new Endpoint() {
        @Override
        public void onOpen(Session session, EndpointConfig config) {
          System.out.println("Connected!!!!!");
        }
      },
      ClientEndpointConfig.Builder.create().build(), // for some reason I have to provide that default config; Not so w/ Tyrus 
      securedEndpointURL);
      
      

      causes the following exception:

      Exception in thread "main" java.io.IOException: For now upgrade responses must have a content length of zero.
      	at org.xnio.http.HttpUpgrade$HttpUpgradeState.handleUpgrade(HttpUpgrade.java:351)
      	at org.xnio.http.HttpUpgrade$HttpUpgradeState.access$900(HttpUpgrade.java:112)
      	at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:335)
      	at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:281)
      	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      	at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
      	at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:87)
      	at org.xnio.nio.WorkerThread.run(WorkerThread.java:531)
      

        Attachments

          Activity

            People

            Assignee:
            swd847 Stuart Douglas
            Reporter:
            mwessendorf Matthias Wessendorf
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: