tyrus
  1. tyrus
  2. TYRUS-44

Binary data not handled correctly by a WebSocket endpoint

    Details

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

      Description

      Sending binary data to a WebSocket endpoint as:

      function sendBinary() {
      blob = new Blob([nameField2.value],

      {type: "application/octet-stream"}

      );
      websocket.send(blob);
      writeToScreen("SENT (binary): " + nameField2.value);
      }

      The method signatures is:

      @WebSocketMessage
      public byte[] sayHello2(byte[] data)

      { System.out.println("sayHello2"); return data; }

      The exception thrown is:

      INFO: Request URI: /HelloWebSocket/hello
      SEVERE: java.lang.Exception
      at org.glassfish.tyrus.platform.EndpointWrapper.processCompleteMessage(EndpointWrapper.java:285)
      at org.glassfish.tyrus.platform.EndpointWrapper.onMessage(EndpointWrapper.java:220)
      at org.glassfish.tyrus.spi.grizzlyprovider.GrizzlyEndpoint.onMessage(GrizzlyEndpoint.java:89)
      at org.glassfish.grizzly.websockets.DefaultWebSocket.onMessage(DefaultWebSocket.java:157)
      at org.glassfish.grizzly.websockets.frametypes.BinaryFrameType.respond(BinaryFrameType.java:52)
      at org.glassfish.grizzly.websockets.DataFrame.respond(DataFrame.java:104)
      at org.glassfish.grizzly.websockets.WebSocketFilter.handleRead(WebSocketFilter.java:221)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:781)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:578)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558)
      at java.lang.Thread.run(Thread.java:722)

      SEVERE: at org.glassfish.tyrus.platform.EndpointWrapper.processCompleteMessage(EndpointWrapper.java:285)
      SEVERE: at org.glassfish.tyrus.platform.EndpointWrapper.onMessage(EndpointWrapper.java:220)
      SEVERE: at org.glassfish.tyrus.spi.grizzlyprovider.GrizzlyEndpoint.onMessage(GrizzlyEndpoint.java:89)
      SEVERE: at org.glassfish.grizzly.websockets.DefaultWebSocket.onMessage(DefaultWebSocket.java:157)
      SEVERE: at org.glassfish.grizzly.websockets.frametypes.BinaryFrameType.respond(BinaryFrameType.java:52)
      SEVERE: at org.glassfish.grizzly.websockets.DataFrame.respond(DataFrame.java:104)
      SEVERE: at org.glassfish.grizzly.websockets.WebSocketFilter.handleRead(WebSocketFilter.java:221)
      SEVERE: at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      SEVERE: at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
      SEVERE: at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
      SEVERE: at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
      SEVERE: at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      SEVERE: at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      SEVERE: at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:781)
      SEVERE: at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      SEVERE: at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      SEVERE: at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      SEVERE: at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      SEVERE: at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:578)
      SEVERE: at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558)
      SEVERE: at java.lang.Thread.run(Thread.java:722)
      INFO: Grizzly endpoint onClose

      This is with b06 integrated in latest GlassFish build.

        Activity

        arungupta created issue -
        dannycoward made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Martin Matula made changes -
        Fix Version/s 1.0 [ 16078 ]
        Fix Version/s 1.0-b08 [ 16095 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: