首页 > 编程语言 > 详细

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

时间:2019-12-22 12:19:28      阅读:102      评论:0      收藏:0      [点我收藏+]

1、问题描述

严重: Servlet.service() for servlet [default] in contextwith path [/OxygenCloud] threw exception

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

技术分享图片

 

 

 

2、问题分析

从提示错误的字面意思判断“Cannotcall sendError() after the response has been committed”,“当response被提交后不能调用sendError()”。

出现这个错误,应该是多次response导致的,可以这么理解,http server发送response后就关闭了socket,这个时候再次发送response给http client就会出现这个问题。

例子:

技术分享图片

 

 

 技术分享图片

 

 

 

3、问题解决

查看我的代码里面的情况:

技术分享图片

 

 重启运行,这个问题就没有了。

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

原文:https://www.cnblogs.com/qingmuchuanqi48/p/12079402.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!