500 error handling in Spring MVC

Viewed 13123

I developed my project with hybris.And I want to some template in 500Error.jsp but I can't handle 500 error.Next I can't get jsp file.

I got this error:

SEVERE: Servlet.service() for servlet DispatcherServlet threw exception
java.lang.NullPointerException

Aug 10, 2017 3:14:07 PM org.apache.catalina.core.StandardHostValve custom
SEVERE: Exception Processing ErrorPage[exceptionType=java.lang.Throwable, location=/serverError]
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException

in web.xml file

<error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/serverError</location>
</error-page>

in Controller.java following method

@RequestMapping(value = "serverError", method = RequestMethod.GET)
    public String renderErrorPage(final Model model, HttpServletRequest httpRequest) throws CMSItemNotFoundException {
3 Answers
Related