Joakim - thanks for reviewing the code, and creating the bug. Quick
followup question - do you know how long a bug like this usually takes to
fix? I can understand that there are no guarantees, I'm just looking for a
rough estimate - a few days, a few months, etc. I'm curious because the
project I'm working on will be rolling out in the next month and a half,
and I'll need to make a call on whether to wait for the fix or not. Thanks!

On Thu, Oct 9, 2014 at 10:43 AM, Joakim Erdfelt <[email protected]> wrote:

> Response being committed, means something in your chain, your servlet,
> your filter, or your CustomResponseWrapper has already started to write a
> response, and the effort to add a new session cookie cannot be performed at
> that point in time.
>
> Look closer at com.shandianshua.satoshi.online.api.http.filter.
> ContentEnteiFilter.doFilter(ContentEnteiFilter.java:51)
>
> Once the response headers have been sent, the response is "committed" and
> changes to the response / headers can no longer be made.
>
> The last call in your stacktrace, to Request.getSession() is attempting to
> add an outgoing cookie for the session to the response, but the response
> has already been started.
>
> --
> Joakim Erdfelt <[email protected]>
> webtide.com <http://www.webtide.com/> - intalio.com/jetty
> Expert advice, services and support from from the Jetty & CometD experts
> eclipse.org/jetty - cometd.org
>
> On Thu, Oct 9, 2014 at 8:12 AM, Pikachu Absol <[email protected]>
> wrote:
>
>> Hi,
>>
>> I write a filter to do something for the response, and host the war in Stable
>> 9.2.3.v20140905
>>
>>     public void doFilter (
>>         ServletRequest request,
>>         ServletResponse response,
>>         FilterChain chain
>>     ) throws IOException, ServletException {
>>         HttpServletRequest httpRequest = (HttpServletRequest) request;
>>         HttpServletResponse httpResponse = (HttpServletResponse) response;
>>
>>         CustomResponseWrapper wrapper =
>> new CustomResponseWrapper(httpResponse);
>>         LOG.info("============is commited:\t" + response.isCommitted());
>> *        chain.doFilter(request, wrapper);*
>>
>>          // code never get here
>>     }
>>
>> I got the an exception below:
>>
>> 2014-10-09 22:58:23.124:WARN:oejs.ServletHandler:qtp2128697132-18:
>> /v1/hello
>> java.lang.IllegalStateException: Response is committed
>>         at org.eclipse.jetty.server.Request.getSession(Request.java:1401)
>>         at
>> org.eclipse.jetty.security.authentication.FormAuthenticator.validateRequest(FormAuthenticator.java:260)
>>         at
>> org.eclipse.jetty.security.authentication.DeferredAuthentication.authenticate(DeferredAuthentication.java:68)
>>         at
>> org.eclipse.jetty.server.Request.getUserPrincipal(Request.java:1480)
>>         at
>> org.springframework.web.servlet.FrameworkServlet.getUsernameForRequest(FrameworkServlet.java:1022)
>>         at
>> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:958)
>>         at
>> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>>         at
>> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>>         at
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
>>         at
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
>>         at
>> org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:172)
>>         at
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
>>         at
>> com.shandianshua.satoshi.online.api.http.filter.ContentEnteiFilter.doFilter(ContentEnteiFilter.java:51)
>>         at
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
>>         at
>> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
>>         at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
>>         at
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
>>         at
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
>>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>>         at
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
>>         at
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
>>         at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
>>         at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
>>         at
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
>>         at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
>>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>>         at
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
>>         at
>> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
>>         at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
>>         at org.eclipse.jetty.server.Server.handle(Server.java:497)
>>         at
>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
>>         at
>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
>>         at
>> org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
>>         at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
>>         at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
>>         at java.lang.Thread.run(Thread.java:745)
>>
>> Since I can't find any solutions or similar cases on Google, I switch to 
>> Stable
>> 8.1.16.v20140903 with the exactly same war, and then the problem just
>> disappear, everything runs fine.
>>
>> Can somebody help ?
>>
>> Thanks!
>>
>> _______________________________________________
>> jetty-users mailing list
>> [email protected]
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>
>
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to