java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
2017-08-08 14:19
746 查看
java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:482)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.websocket.pojo.PojoMessageHandlerWholeBase.onMessage(PojoMessageHandlerWholeBase.java:80)
at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:399)
at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:500)
at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:295)
at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:131)
at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:73)
at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:131)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:114)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker$2.run(Invoker.java:218)
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Session 0 close because of CloseReason: code [1006], reason [An unrecoverable IOException occurred so the connection was closed]
解决办法:
在跳转语句后面加上一个return;即可
at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:482)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.websocket.pojo.PojoMessageHandlerWholeBase.onMessage(PojoMessageHandlerWholeBase.java:80)
at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:399)
at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:500)
at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:295)
at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:131)
at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:73)
at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:131)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:114)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker$2.run(Invoker.java:218)
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Session 0 close because of CloseReason: code [1006], reason [An unrecoverable IOException occurred so the connection was closed]
解决办法:
在跳转语句后面加上一个return;即可
相关文章推荐
- Java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
- java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
- java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
- [error handle][java web]Cannot call sendRedirect() after the response has been committed
- [Java][Servlet] Cannot call sendRedirect() after the response has been committed
- java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been commi
- Cannot call sendRedirect() after the response has been committed
- Cannot call sendRedirect() after the response has been committed 解决方案
- HTTP Status 500 - Cannot call sendRedirect() after the response has been committed
- Cannot call sendRedirect() after the response has been committed
- java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
- 逻辑没错但是报:Cannot call sendRedirect() after the response has been committed/HTTP Status 405
- Cannot call sendRedirect() after the response has been committed
- java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
- Cannot call sendRedirect() after the response has been committed
- jsp页面出错 Cannot call sendRedirect() after the response has been committed
- java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
- 木其工作室代写程序 [原]java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
- java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
- java.lang.IllegalStateException: Cannot call sendError() after the response has been committed