java.lang.IllegalStateException: Current state = FLUSHED, new state = CODING_END
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Thomas_Gamble
Posted On:   Wednesday, June 26, 2002 01:18 PM

I am receiving the following error from my servlet. The error does not seem to occur consistently, and only occurs on occasion. I understand the concept of an IllegalStateException, but do not understand what is the cause of this one. It seems to relate to the output buffer being flushed, but I have no idea what CODING_END means and why this is an illegal state. I can only speculate that it has something to do with the "code ending". Any suggestions as to what I might look for to find this problem would be greatly appreciated. java.lang.IllegalStateException: Current state = FLUSHED, new state = CODING_END at java.nio.charset.CharsetEncoder.throwIllegalStateException(CharsetEnc    More>>

I am receiving the following error from my servlet. The error does not seem to occur consistently, and only occurs on occasion. I understand the concept of an IllegalStateException, but do not understand what is the cause of this one. It seems to relate to the output buffer being flushed, but I have no idea what CODING_END means and why this is an illegal state. I can only speculate that it has something to do with the "code ending".


Any suggestions as to what I might look for to find this problem would be greatly appreciated.


			
java.lang.IllegalStateException: Current state = FLUSHED, new state = CODING_END

at java.nio.charset.CharsetEncoder.throwIllegalStateException(CharsetEnc
oder.java:933)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:529)
at sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar(StreamEncoder.ja
va: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(ResponseBas
e.java:482)
at org.apache.catalina.connector.HttpResponseBase.finishResponse(HttpRes
ponseBase.java:236)
at org.apache.catalina.connector.http.HttpResponseImpl.finishResponse(Ht
tpResponseImpl.java:288)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
r.java:1039)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
va:1107)
at java.lang.Thread.run(Thread.java:536)
   <<Less

Re: java.lang.IllegalStateException: Current state = FLUSHED, new state = CODING_END

Posted By:   Andrew_Christian  
Posted On:   Saturday, September 21, 2002 04:04 PM

I had the same problem and it only became apparent when I upgraded from 1.3.1 to 1.4. The cause of my problem was this: My servlet had done a response.sendRedirect() and then subsequently tried to close a PrintWriter object obtained from response.getWriter(). When I removed the code that closed the PrintWriter, I stopped getting this Exception.

Re: java.lang.IllegalStateException: Current state = FLUSHED, new state = CODING_END

Posted By:   silve_free  
Posted On:   Thursday, September 12, 2002 07:12 AM

OK, I have got the same problem

*******************************
java.lang.IllegalStateException: Current state = FLUSHED, new state = CODING_END

at java.nio.charset.CharsetEncoder.throwIllegalStateException(CharsetEnc
oder.java:933)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:529)
at sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar(StreamEncoder.ja
va: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)
*************************************

In my case, it was a crach of the ClassLoader of JDK. So, i have change my JDK, and this problem go away.
My old JDK was : j2sdk1.4.0_01
My new JDK is from Jbuilder : JDK 1.3
About | Sitemap | Contact