Request processing failed; nested exception is java.lang.IllegalStateException: getOutputStream() has already been called for this response
问题分析:
在ServletRequest servletRequest中已经存在一个项目名称,此时,又用项目名称访问 http://localhost:8080/rent/pdf/preview rent这个名称已经在Application.yml中设置了,
这时会生成一个缓存在servletRequest中,访问就会有重复的/rent,就会报错
解决方案
清空servletRequest中存在的/rent缓存
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException { HttpServletResponse response = (HttpServletResponse) servletResponse; response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,Content-Type,XFILENAME,XFILECATEGORY,XFILESIZE"); logger.info("*********************************过滤器被使用**************************");
try {
filterChain.doFilter(servletRequest, servletResponse);
} catch (IllegalStateException e) {
servletRequest.getServletContext().removeAttribute("/rent");
} catch (ServletException e) {
e.printStackTrace();
} }
重点:
catch (IllegalStateException e) {
servletRequest.getServletContext().removeAttribute("/rent");
}
Request processing failed; nested exception is java.lang.IllegalStateException: getOutputStream() has already been called for this response的更多相关文章
- HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException
HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException type ...
- HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: Control character in cookie value or attribute.
HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: ...
- Request processing failed; nested exception is java.lang.IllegalArgumentException: No converter found for return value of type: class cn.e3mall.pojo.TbItem
这个异常是缺少json相关的包 把以下依赖补上就好: <!-- Jackson Json处理工具包 --><dependency> <groupId>com.fas ...
- error:org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
问题:调用的方法在一个接口类中,但我并没有注入那个被调用的类 解决:在UserEntity前加上@Autowired @Controller public class MainController { ...
- 报错:严重: Servlet.service() for servlet [springmvc] in context with path [ ] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
解决:service类或dao类需要@Autowired
- SSM框架报HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException错
如下图 一番排查之后发现原来是server层写漏注释了 粗心大意,一天内出现两次写漏注释,SSM框架有意思.
- 14- Servlet.service() for servlet [mvc-dispatcher] in context with path [/collegeservice] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root caus
有的service没有依赖注入:
- Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config解决
出现这个问题往往伴随 HTTP-500错误 报错信息: HTTP Status - Handler processing failed; nested exception is java.lang. ...
- org.springframework.web.util.NestedServletException : Handler processing failed; nested exception is java.lang.StackOverflowError
1 ,错误原因,循环冗余检查 result.setNearUsers(userList); Page page = new Page(); pag ...
随机推荐
- 涂抹mysql笔记-安装mysql
1.mysql安装:(1)RPM安装:rpm -ivh xxx 建议安装三个:MySQL-server-VERSION.PLATFORM-cpu.rpmMySQL-client-VERSION.PLA ...
- MyElipse10添加Git
1.下载对应MyEclipse的egit,教程用的是22.2的 http://wiki.eclipse.org/EGit/FAQ#Where_can_I_find_older_releases_of_ ...
- CentOS7 安装kafka集群
1. 环境准备 JDK1.8 ZooKeeper集群(参见本人博文) Scala2.12(如果需要做scala开发的话,安装方法参见本人博文) 本次安装的kafka和zookeeper集群在同一套物理 ...
- ffmpeg 编译
下载FFmpeg git clone https://git.ffmpeg.org/ffmpeg.git 配置编译FFmpeg ./configure --prefix=host --enable-s ...
- [python,2018-03-06] python中的继承顺序
python 支持多继承,但对与经典类和新式类来说,多继承查找的顺序是不一样的. 经典类: 新式类 class P1: def foo(self): ...
- tomcat advanced (RUNNING)
1. 1. tomcat
- android toolbar效果4
两个标题的,右边一个按钮 activity_main.xml: <android.support.v7.widget.Toolbar style="style/toolbarStyle ...
- <记录> HtmlHelper和 强类型页面
HtmlHelper 路径生成 <!--普通写法--> <a href="/home/index">超链接</a> <!--利用Url类 ...
- MYSQL性能优化(2)
Insert语句优化 1. 多行并为一个语句 insert into table values (行1),(行2),........... 2. 使用中间内存队列, 逻辑是立马执行插入,其他数据放 ...
- 关于HashMap和HashTable.md
目录 先来些简单的问题 你用过HashMap吗?" "什么是HashMap?你为什么用到它?" "你知道HashMap的工作原理吗?" "你 ...