Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 33704 invoked from network); 3 Mar 2002 03:51:51 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 3 Mar 2002 03:51:51 -0000 Received: (qmail 24198 invoked by uid 97); 3 Mar 2002 03:51:39 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 24180 invoked by uid 97); 3 Mar 2002 03:51:39 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 24168 invoked from network); 3 Mar 2002 03:51:38 -0000 Message-ID: <013e01c1c266$e33e05b0$6501a8c0@apache.org> From: "Remy Maucherat" To: "Tomcat Users List" References: <20020303034153.91963.qmail@web20310.mail.yahoo.com> Subject: Re: ??? TC 4.0.2 Throws Exceptions ??? Date: Sat, 2 Mar 2002 19:52:47 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: localhost.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > 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: > For additional commands: > Troubles with the list: > -- To unsubscribe: For additional commands: Troubles with the list: