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 ...
随机推荐
- 【Linux】【Jenkins】系统配置报反向代理设置有误问题的解决方案
1.如图所示: 2.点击更多信息,查看解决办法: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+says+my+reverse+proxy+s ...
- org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.util.HashMap
这样的配置有问题吗? <select id="getFreightCollectManagementList" resultMap="java.util.HashM ...
- jquery与原生JS实现增加、减小字号功能
预览效果: 实现代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset=&qu ...
- leetcode17
回溯法,深度优先遍历(DFS) public class Solution { int[] x; int N; string DIGITS; Dictionary<char, List<s ...
- leetcode1027
最直接的思路是三层循环,但是会超时,代码如下: public class Solution { public int LongestArithSeqLength2(int[] A) { ; var l ...
- Rocket MQ 1 - 用
参考 http://www.iocoder.cn/categories/RocketMQ/ ; https://www.jianshu.com/nb/16219849 首先上启动方法,分别启动name ...
- Week__8
Monday_ 今晚补了扔鸡蛋问题的动态规划问题,补了这道题,感觉视野又开阔了些. 写了一道思维题cf 1066A 数字逻辑后半节听得打脑壳,现在很晚了,明天再看叭. Tuesday_ 今晚补了 ad ...
- 尚硅谷springboot学习33-整合mybatis
引入mybatis依赖(还要引入mysql和jdbc依赖) <dependency> <groupId>org.mybatis.spring.boot</groupId& ...
- PostgreSQL使用笔记
下载并安装 注意安装图形界面 pgAdmin 需要输入缺省用户 postgres 的密码 在 Windows 下安装之后注意把 bin文件夹加到 Path 环境变量中. 重置密码 使用管理员权限打开 ...
- 高性能迷你React框架anujs1.1.0发布
本版本对setState与forceUpdate内部依赖的setStateImpl进行了重构,性能稳定在60pfs之上.并且将组件实例的所有内部方法与属性都改成以___开头. https://gith ...