I am getting troubles with handling exceptions in web servlet app. I've created ErrorHandler servlet, which handles all incoming exceptions and added entry in web.xml file :
<servlet>
<servlet-name>ErrorHandler</servlet-name>
<servlet-class>ServletPackage.ErrorHandler</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ErrorHandler</servlet-name>
<url-pattern>/ErrorHandler</url-pattern>
</servlet-mapping>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/ErrorHandler</location>
</error-page>
The problem is the server does not invoke ErrorHandler servlet at all. Glassfish just throws Exception in the console and web browser refreshes the servlet which thrown exception (with no data due to unhandled exception).
Warning: StandardWrapperValve[SessionChecker]: Servlet.service() for servlet SessionChecker threw exception
javax.servlet.ServletException: Forced exception thrown
at ServletPackage.SessionChecker.processRequest(SessionChecker.java:158)
at ServletPackage.SessionChecker.doPost(SessionChecker.java:174)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
.
.
.
Any suggestions?
Aucun commentaire:
Enregistrer un commentaire