各位大神有碰到过:Cannot call sendError() after the response has been committed吗?

采用输入框input保存--内容就会报错:



八月 11, 2016 9:30:47 上午 org.apache.catalina.core.StandardWrapperValve invoke

严重: Servlet.service() for servlet [default] in context with path [] threw exception

java.lang.IllegalStateException: Cannot call sendError() after the response has been committed

at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:462)

at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:726)

at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:398)

at org.apache.catalina.servlets.DefaultServlet.doPost(DefaultServlet.java:480)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:82)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)


评论区

JFinal

2016-08-11 09:55

异常链中除了 JFinalFilter 没有其它有关 jfinal 的任何内容,没法确定错误

tony2015

2016-08-11 11:56

@JFinal 就是直接下载dome运行,做保存操作,其中的字段的内容包含:"--"就可以出现了

JFinal

2016-08-11 13:55

@tony2015 我在本地测试了一下 demo,没有问题,难道是你数据库的字符集不支持 "--"? 这也说不通,因为这两个字符是再普通不过的字符了。你确定对 demo 没做任何改动?

再确定一下,你的 tomcat 的 webapps 下面有没有别的项目存在? 可能存在干扰

tony2015

2016-08-11 14:22

@JFinal 原因找到,是我自己项目的问题,项目代码有sql关键字过滤

tony2015

2016-08-11 14:22

热门反馈

扫码入社