2013/11/26 Nick Williams <nicho...@nicholaswilliams.net>: > > On Nov 25, 2013, at 9:11 PM, Konstantin Kolinko wrote: > >> 2013/11/25 Nick Williams <nicho...@nicholaswilliams.net>: >>> I've written a simple Servlet/WebSocket client that sends a message over >>> the Session each time a GET request comes in. This worked a few months ago: >>> >>> @Override >>> protected void doGet(HttpServletRequest request, HttpServletResponse >>> response) >>> throws ServletException, IOException >>> { >>> ClusterMessage message = new ClusterMessage(this.nodeId, >>> "request:{ip:\"" + request.getRemoteAddr() + >>> "\",queryString:\"" + request.getQueryString() + "\"}"); >>> >>> try(OutputStream output = >>> this.session.getBasicRemote().getSendStream(); >>> ObjectOutputStream stream = new ObjectOutputStream(output)) >>> { >>> stream.writeObject(message); >>> } >>> response.getWriter().append("OK"); >>> } >>> >>> But on the latest trunk, I get this error on the first request to doGet: >>> >>> java.lang.IllegalStateException: The remote endpoint was in state >>> [STREAM_WRITING] which is an invalid state for called method >>> >>> org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.checkState(WsRemoteEndpointImplBase.java:1014) >>> >>> org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.binaryPartialStart(WsRemoteEndpointImplBase.java:961) >>> >>> org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendPartialBytes(WsRemoteEndpointImplBase.java:140) >>> >>> org.apache.tomcat.websocket.WsRemoteEndpointImplBase$WsOutputStream.doWrite(WsRemoteEndpointImplBase.java:838) >>> >>> org.apache.tomcat.websocket.WsRemoteEndpointImplBase$WsOutputStream.flush(WsRemoteEndpointImplBase.java:821) >>> >>> java.io.ObjectOutputStream$BlockDataOutputStream.flush(ObjectOutputStream.java:1823) >>> java.io.ObjectOutputStream.flush(ObjectOutputStream.java:719) >>> java.io.ObjectOutputStream.close(ObjectOutputStream.java:740) >>> com.wrox.ClusterNodeServlet.doGet(ClusterNodeServlet.java:72) >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:621) >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:728) >>> >>> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) >>> >>> On all subsequent requests, I get this error: >>> >>> java.lang.IllegalStateException: The remote endpoint was in state >>> [STREAM_WRITING] which is an invalid state for called method >>> >>> org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.checkState(WsRemoteEndpointImplBase.java:1014) >>> >>> org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.streamStart(WsRemoteEndpointImplBase.java:951) >>> >>> org.apache.tomcat.websocket.WsRemoteEndpointImplBase.getSendStream(WsRemoteEndpointImplBase.java:190) >>> >>> org.apache.tomcat.websocket.WsRemoteEndpointBasic.getSendStream(WsRemoteEndpointBasic.java:62) >>> com.wrox.ClusterNodeServlet.doGet(ClusterNodeServlet.java:68) >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:621) >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:728) >>> >>> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) >>> >>> I'm guessing I need to file a BZ, but I wanted to make sure. I don't see >>> how I could possibly be doing anything wrong in this simple code. >>> >> >> >> There was this change: >> http://svn.apache.org/viewvc?view=revision&revision=1544213 >> >> <fix> >> <bug>55799</bug>: Correctly enforce the restriction in JSR356 that no >> more than one data message may be sent to a remote WebSocket endpoint >> at >> a time. (markt) >> </fix> > > Problem is, I'm only sending one data message. That's it. The very first and > only data message I send triggers the first error. The second error is before > I even get to sending a data message; it's when I retrieve a stream. > Something's definitely broken. Even IF I were sending multiple messages > (again, I'm not); they should be queued, not result in an error that leaves > the Session in an inconsistent state indefinitely.
I reopened the bug, https://issues.apache.org/bugzilla/show_bug.cgi?id=55799#c15 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org