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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -