Java.lang.ClassCastException cannot be passed to javax.servlet.ServletException

I am trying to deploy a java application for appspot (google appengine). I am new to java, so bear with me. When I run the application locally from eclipse, it works fine. By uploading it to google appspot, I get an error message (only on one of the .jsp pages, other .jsp pages work fine). The error log says:

   Uncaught exception from servlet

java.lang.ClassCastException: java.lang.ClassCastException cannot be cast to javax.servlet.ServletException
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:754)

Can anyone shed some light on this question? What could be wrong on this page? If you want to see the page code, let me know.

+3
source share
2 answers

, - , ServletException. () - .

, , , , , , .

, , try... catch, Throwable. , ServletException:

try {
    // handle page request
} catch (Throwable t) {
    throw new ServletException(t);
}

- , . , , , .

+2

javax.servlet.ServletException.class WEB-INF/lib. servler.jar servlet.api.jar WAR.

0

Source: https://habr.com/ru/post/1722364/


All Articles