You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by "florin.g" <fl...@bytenotes.com> on 2009/05/31 20:50:17 UTC

This output stream has already been closed?

Anyone has an idea how this comes about? 

I thought it might be a character encoding mismatch yet the files work fine
on one machine (weindows/dev) yet this error appears in production (centos). 

[error] handleException: java.io.IOException: This output stream has already
been closed
        at
org.apache.click.extras.filter.CompressionResponseStream.close(CompressionResponseStream.java:121)
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:357)
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:140)
        at org.apache.click.ClickServlet.processPage(ClickServlet.java:648)
        at
org.apache.click.ClickServlet.handleRequest(ClickServlet.java:334)
        at org.apache.click.ClickServlet.doGet(ClickServlet.java:253)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
        at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1120)
        at
org.apache.click.extras.filter.PerformanceFilter.doFilter(PerformanceFilter.java:344)
        at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)
        at main.XSS.doFilter(XSS.java:25)
        at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
        at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:219)
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:786)
        at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:431)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:188)
        at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:325)
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:533)
        at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:856)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:523)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:391)
        at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:235)
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:497)
 
-- 
View this message in context: http://n2.nabble.com/This-output-stream-has-already-been-closed--tp3002771p3002771.html
Sent from the click-user mailing list archive at Nabble.com.


Re: This output stream has already been closed?

Posted by Bob Schellink <sa...@gmail.com>.
florin.g wrote:
> 
> I suspect a change on my side that results in this. I don't know what
> though. 


The error seems to occur when you do a forward from your Page.


> 
> Click: click-2.0.1-incubating
> Jetty: jetty-7.0.0.pre3


I'll have a look with this setup if I can produce the error. Have you 
tried a later version of Jetty to see if the problem persist?

You could also change CompressionResponseStream.close as follows and 
rebuild Click:

   public void close() throws IOException {
     if (closed) {
       return;
     }

     ...
   }

Perhaps do the same with the flush() method as that also throws the 
same exception. Let us know if that resolves the issue or if things 
break :)

kind regards

bob

Re: This output stream has already been closed?

Posted by "florin.g" <fl...@bytenotes.com>.
Bob,

I suspect a change on my side that results in this. I don't know what
though. 

Click: click-2.0.1-incubating
Jetty: jetty-7.0.0.pre3

This jetty instance has been running for months with no incident. I noticed
this issue about 2 weeks ago. Would a dir of /lib/ be useful?





sabob wrote:
> 
> Also which version of Click is this?
> 
> 
> Bob Schellink wrote:
>> Hi Florin,
>> 
>> florin.g wrote:
>>>
>>> I thought it might be a character encoding mismatch yet the files work 
>>> fine
>>> on one machine (weindows/dev) yet this error appears in production 
>>> (centos). 
>> 
>> 
>> The GZip compression is only active in production modes which explains 
>> why you're not seeing this in dev.
>> 
>> 
>>> [error] handleException: java.io.IOException: This output stream has 
>>> already
>>> been closed
>>>         at
>>> org.apache.click.extras.filter.CompressionResponseStream.close(CompressionResponseStream.java:121) 
>>>
>> 
>> 
>> I'll have a look. Which version of Jetty are you using? Are you seeing 
>> this exception for every request or is it only for specific pages?
>> 
>> My feeling is that CompressionResponseStream should simply return if it 
>> is already close instead of throwing the exception.
>> 
>> kind regards
>> 
>> bob
>> 
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/This-output-stream-has-already-been-closed--tp3002771p3004067.html
Sent from the click-user mailing list archive at Nabble.com.


Re: This output stream has already been closed?

Posted by Bob Schellink <sa...@gmail.com>.
Also which version of Click is this?


Bob Schellink wrote:
> Hi Florin,
> 
> florin.g wrote:
>>
>> I thought it might be a character encoding mismatch yet the files work 
>> fine
>> on one machine (weindows/dev) yet this error appears in production 
>> (centos). 
> 
> 
> The GZip compression is only active in production modes which explains 
> why you're not seeing this in dev.
> 
> 
>> [error] handleException: java.io.IOException: This output stream has 
>> already
>> been closed
>>         at
>> org.apache.click.extras.filter.CompressionResponseStream.close(CompressionResponseStream.java:121) 
>>
> 
> 
> I'll have a look. Which version of Jetty are you using? Are you seeing 
> this exception for every request or is it only for specific pages?
> 
> My feeling is that CompressionResponseStream should simply return if it 
> is already close instead of throwing the exception.
> 
> kind regards
> 
> bob
> 


Re: This output stream has already been closed?

Posted by Bob Schellink <sa...@gmail.com>.
Hi Florin,

florin.g wrote:
> 
> I thought it might be a character encoding mismatch yet the files work fine
> on one machine (weindows/dev) yet this error appears in production (centos). 


The GZip compression is only active in production modes which explains 
why you're not seeing this in dev.


> [error] handleException: java.io.IOException: This output stream has already
> been closed
>         at
> org.apache.click.extras.filter.CompressionResponseStream.close(CompressionResponseStream.java:121)


I'll have a look. Which version of Jetty are you using? Are you seeing 
this exception for every request or is it only for specific pages?

My feeling is that CompressionResponseStream should simply return if 
it is already close instead of throwing the exception.

kind regards

bob