从执行器(/Refresh)刷新spring boot云应用程序时出现以下异常。它在独立的tomcat服务器上运行。它正在使用SpringBootServletInitializer。:
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.IllegalStateException: Filters can not be added to context /ROOT as the context has
throw new MyException();}
public class MyException extends Exception {问题:
ErrorPageFilter:不能转发到请求/服务/MyWebservice的错误页面,因为响应已经提交。如果您的应用程序运行在com.ibm.ws.webcontainer.invokeFlushAfterService应用服务器上,则可以通过将WebSphere设置为fals
似乎Spring的ErrorPageFilter将我的所有HTTP状态代码更改为200 OK (除了4xx)。这只在部署到Servlet容器时才会发生。这是个窃听器还是我做错什么了?经过一些调试后,我发现ErrorPageFilter没有将状态代码从包装的响应委托给真实的响应。我知道我可以在控制器中返回ResponeEntity,但是我的实际问题发生在发送304的另一个框架的Servlet上--这个控制器只是为了演示。
还有其他人看过这个吗?
在使用jstack并获得问题的堆栈转储后,我发现了以下内容:at org.springframework.boot.context.web.ErrorPageFilter.doFilter(ErrorPageFilter.java(ErrorPageFilter.java:119)
at org.springframework.boot.context.web.ErrorPageFilter.doFilter(Error
(ErrorPageFilter.java:164)at org.springframework.boot.context.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:104)
at org.springframework.boot.context.web