Details
Description
When unmarshal json payload to JAXB annotated bean sometimes we can get an UnmarshallingException (e.g. for dates). That exception already contains very descriptive message. AbstractJAXBProvider#handleExceptionStart extracts it. Then in AbstractJAXBProvider#handleJAXBException:
AbstractJAXBProvider#handleJAXBException
if (linked != null && linked.getMessage() != null) { Throwable cause = linked; while (read && cause != null) { if (cause instanceof XMLStreamException && cause.getMessage().startsWith("Maximum Number")) { throw ExceptionUtils.toWebApplicationException(null, JAXRSUtils.toResponse(413)); } if (cause instanceof DepthExceededStaxException) { throw ExceptionUtils.toWebApplicationException(null, JAXRSUtils.toResponse(413)); } cause = cause.getCause(); } sb.append(linked.getMessage()).append(". "); // this causes the problem }
This code adds another message from linked exception. Message text is the same. Finally we get something like:
JAXBException occured: <error text>. <error text>.
Attachments
Issue Links
- links to