在我的应用程序中进行一些操作时,我得到了
java.lang.IllegalStateException无法调用sendError()
当我再次重新加载页面时,它可以正常工作一段时间,但是一段时间后,它将显示相同的异常。我该如何克服这个例外?
以下是例外:
HTTP Status 500 - Cannot call sendError() after the response has been committed
type Exception report
message Cannot call sendError() after the response has been committed
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:451)
org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:725)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.40 logs.
Struts.xml
/register.jsp
list
/list.jsp
最佳答案
此错误是其他问题的征兆,而不是您要查找的根本原因。
此错误说明了为什么无法将用户重定向到错误页面。 (原因:服务器已将部分响应缓冲区刷新回客户端-切换/重定向到错误页面为时已晚。)
如错误消息所指出,请检查Apache Tomcat 7日志中的其他地方(或以其他方式调试应用程序)以查找引发异常的原因。