IllegalStateException: PWC3990: getWriter() has already been called for this response
Asked Answered
A

2

0
java.lang.IllegalStateException: PWC3990: getWriter() has already been called for this response

How to solve this error? I run a simple servlet code to display the bar graph.

Aftershock answered 30/11, 2010 at 9:46 Comment(1)
unless you show us some relevant code, how do you think we can guess how to fix your problem?Amalburga
A
6

You cannot call both getOutputStream() and getWriter() on the same response. Keep in mind that JSP implicitly uses getWriter().

Anastasius answered 30/11, 2010 at 12:57 Comment(2)
but how to use getoutputstream in jfreecharts at the same time how to disply the string using getwriter???Aftershock
In theory, you need to write the string to getOutputStream() instead. You can use OutputStreamWriter for this. Since I don't use JFreeChart, I only don't know if it's allowed by JFreeChart to mix the response like that.Anastasius
S
1

Also make sure that the request is not being redirected to current servlet from some place else. If it is, then there is a high probability that one of getOutputStream() or getWriter() has already been called on it.

Sorrell answered 7/8, 2012 at 17:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.