maven - How can I get the stack trace when 500 server error happens in Jersey? -
when in jersey server have server 500 error:
in server response don´t have stack trace or info.
in eclipse console don´t have exception stack trace
i try catch exception in server , print trace in console, nothing happens
how can stack trace when 500 server error happens?
most of time, generic exceptionmapper
trick.
@provider public class debugmapper implements exceptionmapper<throwable> { @override public response toresponse(throwable t) { t.printstacktrace() return response.servererror() .entity(t.getmessage()) .build(); } }
then register it
resourceconfig config = new resourceconfig() .register(debugmapper.class);
sometime exception swallowed jersey when exception not mapped, , not see happened. works, when problem @ jersey level.
Comments
Post a Comment