o.s.b.w.servlet.support.ErrorPageFilter : Cannot forward to error page
for request [/test] as the response has already been committed. As a
result, the response may have the wrong status code. If your application
is running on WebSphere Application Server you may be able to resolve
this problem by setting com.ibm.ws.webcontainer.invokeFlushAfterService
to false
参考了很多办法,有说在启动类中添加如下代码可以解决:
@Bean
public ErrorPageFilter errorPageFilter() {
return new ErrorPageFilter();
}
@Bean
public FilterRegistrationBean disableSpringBootErrorFilter(ErrorPageFilter filter) {
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
filterRegistrationBean.setFilter(filter);
filterRegistrationBean.setEnabled(false);
return filterRegistrationBean;
}
还有包括在pom文件中注释掉内嵌的Tomcat依赖的解决办法。
但是我尝试无果。

<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*
https://blog.csdn.net/ljf12138/article/details/117786285