I have a REST service method that uses the POST http method and accepts application/json. The JSON is bound to a JAXB bean:

public void test(final HierResult obj) throws Exception {

public static class HierResult {
    public String dummy;

I noticed that when somebody sends me a syntactically valid JSON containing unknown field, say { "aaa": "bbb" } then no error is logged, but the web server returns:

HTTP/1.1 400 Bad Request
Server: WildFly/11

Unrecognized field "aaa" (class HierResult), not marked as ignorable

So the question is: how do I log this error?

I registered an ExceptionMapper for java.lang.Exception, but it can only catch JsonParseException or the exceptions thrown by my java method, not the error above.

public class MyExceptionLogger implements ExceptionMapper<Exception> {
    private static final Logger LOGGER = LoggerFactory.getLogger(MyExceptionLogger.class);
    public Response toResponse(final Exception exception1) {
        LOGGER.error("", exception1);
        return Response

public class ApplicationConfig extends Application {
    public Set<Class<?>> getClasses() {
        final Set<Class<?>> resources = new java.util.HashSet<>();
        return resources;
    private void addRestResourceClasses(final Set<Class<?>> resources) {