You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Freeman Yue Fang (Jira)" <ji...@apache.org> on 2021/08/11 20:00:14 UTC

[jira] [Commented] (CXF-8581) Exceptions caught during JSON serialisation aren't handled correctly

    [ https://issues.apache.org/jira/browse/CXF-8581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17397602#comment-17397602 ] 

Freeman Yue Fang commented on CXF-8581:
---------------------------------------

Hi [~msc-isp],

Thanks for reporting this.

However, I've checked the code but I can't see exactly how this could happen.

Any chance you can append a reproducer project? This will definitely expedite to nail down the problem.

Thanks!
Freeman

> Exceptions caught during JSON serialisation aren't handled correctly
> --------------------------------------------------------------------
>
>                 Key: CXF-8581
>                 URL: https://issues.apache.org/jira/browse/CXF-8581
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.4.4
>         Environment: OpenJDK 11
> Windows 10 x64
> Apache CXF 3.4.4
>            Reporter: Marcel Schramm
>            Priority: Major
>
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)