glassfish
  1. glassfish
  2. GLASSFISH-20481

GlassFish does not log exceptions thrown by WebSocket callback methods

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b87_RC3
    • Fix Version/s: 4.1
    • Component/s: web_socket
    • Labels:
      None

      Description

      If a webSocket @OnMessage callback throws a RuntimeException this is ignored by the container and nothing is logged in the server log to indicate that anything went wrong. This can lead to important failures being completely missed.

      Here's an example of a webSocket @OnMessage callback that throws a {{RuntimeException}:

          @OnMessage
          public void onMessage(final String message, final Session client) {
              Logger.getLogger(SampleWebSocket.class.getName()).log(Level.INFO, "SampleWebSocket.onMessage called");
              throw new RuntimeException("Ooh la la");
          }
      

      I think this is a bug in GlassFish. If a RuntimeException exception is thrown by a EJB business method then GlassFish logs it (with a stack trace) in the server log. However if a RuntimeException exception is thrown in a WebSocket callback then nothing is logged.

        Issue Links

          Activity

            People

            • Assignee:
              stepan.kopriva
              Reporter:
              Nigel Deakin
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: