java.lang.IllegalStateException: Cannot call reset() after response has been committed at org.apache.catalina.connector.ResponseFacade.reset(ResponseFacade.java:347) at com.nupoo.spd.config.WebMvcConfig$1.doFilter(WebMvcConfig.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:185)
时间: 2023-11-03 07:04:29 浏览: 239
Java异常之—-Caused by: java.lang.IllegalStateException: Method has too many Body parameters
这个错误是由于在响应已经被提交后调用了reset()方法引起的。在你的代码的第108行(WebMvcConfig.java文件)调用了reset()方法,而此时响应已经被提交,因此会抛出IllegalStateException异常。
为了解决这个问题,你可以检查一下在调用reset()方法之前是否已经提交了响应。如果已经提交了响应,你可以考虑在调用reset()方法之前增加一些条件判断,避免重复调用reset()方法。
另外,你还可以检查一下代码中是否有其他地方也会导致响应被提交,以及是否可以对这些地方进行修复,从而避免出现这个异常。
阅读全文