Spring Boot - Debug Web MVC application in IDE
With Spring Boot Web MVC application, to debug and identify the unexpected exception thrown from a controller while handling http request, put a debug / break point in the following method of the class. This will quickly reveal the exception along with stacktrace with your favourite IDE
Class: org.springframework.web.servlet.DispatcherServlet
Method: doService
Have a breakpoint in the finally block and evaluate as
request.getAttribute("org.springframework.boot.web.servlet.error.DefaultErrorAttributes.ERROR")
Happy Debugging !!!
Comments
Post a Comment