tyrus
  1. tyrus
  2. TYRUS-95

Default port not parsed correctly when connecting to a server

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-b12
    • Component/s: None
    • Labels:
      None

      Description

      Connecting to a remote WebSocket endpoint as:

      WebSocketContainer container = ContainerProvider.getWebSocketContainer();
      String uri = "ws://echo.websocket.org";
      container.connectToServer(MyClient.class, URI.create(uri));

      throws the following exception:

      SEVERE: java.lang.IllegalArgumentException: port out of range:-1
      at java.net.InetSocketAddress.<init>(InetSocketAddress.java:136)
      at org.glassfish.tyrus.container.grizzly.GrizzlyClientSocket.connect(GrizzlyClientSocket.java:155)
      at org.glassfish.tyrus.container.grizzly.GrizzlyEngine.openClientSocket(GrizzlyEngine.java:113)
      at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:207)
      at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:152)
      at org.sample.client.TestRemoteClient.processRequest(TestRemoteClient.java:88)

      Changing the URI to;

      ws://echo.websocket.org:80/

      fixed the error.

        Activity

        Hide
        jitu added a comment -

        Fixing in revision 357.

        Show
        jitu added a comment - Fixing in revision 357.

          People

          • Assignee:
            Unassigned
            Reporter:
            arungupta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: