You seem to have two problems, not sure which one affects you most.
You're missing an
ExceptionMapper
that should map exception types on your backend to HTTP responses.You're getting a
NullPointerException
, regardless of the fact that the code runs within a REST container. Maybe if you look down to the stack trace of thisNullPointerException
, you can get a hint on what's going wrong.