Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8581

Exceptions caught during JSON serialisation aren't handled correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.4.4
    • None
    • JAX-RS
    • None
    • OpenJDK 11

      Windows 10 x64

      Apache CXF 3.4.4

    • Moderate

    Description

      When trying to serialize an object that contains unserializable data, cxf runs into an exception.

      An error log message is printed by `JAXRSUtils.logMessageHandlerProblem`. However, the message contains no stack trace. On top of that the invoking client receives a `200 OK` HTTP status code and partially written JSON, followed by an error message.

       

      What I'd have expected instead, is to use the registered `ExceptionMapper`, which would turn this into an `500 Internal Server Error`. On top of that, it should print the stacktrace, as it's pretty hard to know what's going on otherwise.

       

      In our specific case, we had an object that contains a `java.awt.Font` object.

      Attachments

        Activity

          People

            Unassigned Unassigned
            msc-isp Marcel Schramm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: