You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Amol Puglia <am...@yahoo.com> on 2012/04/19 11:32:04 UTC

Issue in tomcat 6.0.26

Hello Team,

We are getting following error in tomcat.
 Apr 19, 2012 11:10:13 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:610)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125)
at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:276)

Tomcat Version :- Apache Tomcat/6.0.26

JDK Version :- jdk1.6.0_24

Kindly provide the solution.

Let me know if you need more information.

Re: Issue in tomcat 6.0.26

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 4/19/12 1:44 PM, Caldarale, Charles R wrote:
>> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
>> Subject: Re: Issue in tomcat 6.0.26
> 
>>> Kindly provide the solution.
> 
>> Briefly: don't call getOutputStream more than once ;)
> 
> Actually, I think it's don't call _both_ getOutputStream() and 
> getWriter() for the same request.  Pick one or the other.

The JSP writer is supposed to be smart enough to determine which
output is in use (stream vs. writer) and then wrap that. IIRC there is
(was?) an ugly try/catch block that blindly calls getOutputStream and
then calls getWriter as a backup. Obviously, that's no the case here,
so I wonder if something is in a weird state.

That's why I want to see the stack trace.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+QT84ACgkQ9CaO5/Lv0PAwqQCgle/8An+h8rncGKMbIV/IHdOe
bQYAn2YYaqtj8ovP8HH03znBCJCYt7t4
=I7eD
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Issue in tomcat 6.0.26

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
> Subject: Re: Issue in tomcat 6.0.26

> > Kindly provide the solution.

> Briefly: don't call getOutputStream more than once ;)

Actually, I think it's don't call _both_ getOutputStream() and getWriter() for the same request.  Pick one or the other.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

Re: Issue in tomcat 6.0.26

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Amol,

On 4/19/12 5:32 AM, Amol Puglia wrote:
> Hello Team,
> 
> We are getting following error in tomcat. Apr 19, 2012 11:10:13 AM
> org.apache.catalina.core.StandardWrapperValve invoke SEVERE:
> Servlet.service() for servlet jsp threw exception 
> java.lang.IllegalStateException: getOutputStream() has already been
> called for this response at
> org.apache.catalina.connector.Response.getWriter(Response.java:610)
>
> 
at
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198)
> at
> org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125)
>
> 
at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:276)

That can't be the end of the stack trace. Post the whole thing (no
matter how long).

> Tomcat Version :- Apache Tomcat/6.0.26

That's quite old (2 years out of date at this point). You might want
to move up to the latest version to get important security fixes
(including several "Moderate" and "Important" ones) as well as bug fixes.

> Kindly provide the solution.

Briefly: don't call getOutputStream more than once ;)

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+QPGgACgkQ9CaO5/Lv0PCT6ACdGH+weJ2jJxqXVpLdyAqaqzaQ
yD0AoMO5lVOV3fND5fiypVh2i7s6hufl
=FD9+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org