tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remy Maucherat" <r...@apache.org>
Subject Re: ??? TC 4.0.2 Throws Exceptions ???
Date Sun, 03 Mar 2002 03:52:47 GMT
> Hi All,
>
> TC 4.0.2 is throwing an exception on this little
> servlet. Let me emphasize -- *Tomcat* is throwing the
> exception, not the sevlet. I don't believe that TC
> should ever throw an exception, unless there is a bug
> in TC, is that correct?

If you weren't running JDK 1.4, this exception wouldn't happen. So I'm not
convinced yet it's a Tomcat bug. Maybe; maybe not.
FYI, it's already been filed in bugzilla.

> If you run the servlet below you'll see this exception
> thrown by TC:
>
> java.lang.IllegalStateException: Current state =
> FLUSHED, new state = CODING_END
>         at
>
java.nio.charset.CharsetEncoder.throwIllegalStateException(CharsetEncoder.ja
va:933)
>         at
> java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:529)
>         at
>
sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar(StreamEncoder.java:356)
>         at
> sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:413)
>         at
> sun.nio.cs.StreamEncoder.close(StreamEncoder.java:158)
>         at
> java.io.OutputStreamWriter.close(OutputStreamWriter.java:222)
>         at
> java.io.PrintWriter.close(PrintWriter.java:137)
>         at
>
org.apache.catalina.connector.ResponseBase.finishResponse(ResponseBase.java:
482)
>         at
>
org.apache.catalina.connector.HttpResponseBase.finishResponse(HttpResponseBa
se.java:236)
>         at
>
org.apache.catalina.connector.http.HttpResponseImpl.finishResponse(HttpRespo
nseImpl.java:288)
>         at
>
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1039)
>         at
>
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107
)
>         at java.lang.Thread.run(Thread.java:536)
>
>
> Here's the servlet...if you comment out the close()
> the exception goes away.
>
>
> import java.io.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
>
> public class Tester extends HttpServlet {
>    public void doGet(HttpServletRequest req,
> HttpServletResponse res) throws ServletException,
> IOException {
>       res.setContentType("text/plain");
>       PrintWriter out = res.getWriter();
>
>       out.println("Hello #1");
>       out.println("Hello #2");
>       out.println("Hello #3");
>       out.println("Hello #4");
>
>       System.out.println(res.isCommitted());
>       res.sendError(res.SC_REQUEST_ENTITY_TOO_LARGE,
> "sorry dude...");
>       out.close();
>
>    } // doGet()
>
> } // Tester
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - sign up for Fantasy Baseball
> http://sports.yahoo.com
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message