You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by RS...@TRANSENTRIC.COM on 2001/12/13 18:57:54 UTC

java.lang.IllegalStateException

I'm calling a servlet from within another servlet using the URL class. The
calling servlet posts data, reads the output, and then passes on the output
to the browser. In JRun everything works fine. But on Tomcat the same
throws a java.lang.IllegalStateException

Error:
java.lang.IllegalStateException: Writer is already being used for this
request
        at
org.apache.tomcat.facade.HttpServletResponseFacade.getOutputStream(HttpServletResponseFacade.java:158)

I'm using a PrintWriter (which I get from the response object) in the
called servlet. And I've a finally block which closes the stream. Also
assign the object to null.

The calling servlet which behaves like a proxy has a PrintStream (which it
gets from it's response object). This object is used to write the output
(that it reads from the called servlet) to the browser.

I know I'm missing something fundamental here. But can't seem to figure it
out. Is Tomcat getting mixed up with two  Outputstreams/Writers? Any
ideas/comments?

Thanks.
RS



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>