APAR status
Closed as program error.
Error description
Environment:
------------
WebSphere Platform 5.1 [BASE 5.1.1.7 cf70540.03]
JDK 1.4.2 cxia321420-20040626
Host Operating System is Linux, version 2.4.21-9.EL
Problem Summary:
----------------
The issue is that the method sendError() in the
HttpServletResponse throws an exception if the method
getOutputStream() had previously been called, even if no output
was written to the OutputStream. The servlet container
restricts the use of the methods
HttpServletResponse.getOutputStream() and getWriter() to ensure
that each method is called no more than once, and that either
the Writer or the OutputStream are used exclusively. However,
sendError() appears to be using the getWriter() internally, so
if the application had already accessed the OutputStream, it
fails.
In the J2EE API docs for ServletResponse (which is a parent
interface for HttpServletResponse), both the getWriter method
and getOutputStream method will throw an IllegalStateException
if both of them are called.
The following simple JSP will demonstrate the problem:
<%@ page buffer="64kb" %>
<%
java.io.OutputStream stream = response.getOutputStream();
response.sendError(404);
%>
Local fix Problem summary
****************************************************************
* USERS AFFECTED: WebSphere Application Server users of *
* servlets that obtain an OutputStream before *
* calling sendError() and do not have an *
* error page defined. *
****************************************************************
* PROBLEM DESCRIPTION: An IllegalStateException is thrown *
* when a servlet obtains an OutputStream *
* before calling sendError() and an error *
* page has not been defined. *
****************************************************************
* RECOMMENDATION: *
****************************************************************
The WebContainer attempts to obtain a PrintWriter when
sendError is called and the user has not defined an error
page. If the servlet has already obtained an OutputStream
before calling sendError, an IllegalStateException will be
thrown since it is illegal to obtain both a PrintWriter and
an OutputStream.
Problem conclusion
Code was modified to catch the IllegalStateException and
utilize the OutputStream in that case.
The fix for this APAR is currently targeted for inclusion
in fixpacks 5.02.18 and 5.1.1.11.
Please refer to the recommended updates page for delivery
information:
http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Temporary fix Comments
APAR information |
APAR number |
PK23496 |
Reported component name |
WAS NETWRK DEPL |
Reported component ID |
5630A3601 |
Reported release |
10I |
Status |
CLOSED PER |
PE |
NoPE |
HIPER |
NoHIPER |
Special Attention |
NoSpecatt |
Submitted date |
2006-04-17 |
Closed date |
2006-04-27 |
Last modified date |
2006-04-27 |
APAR is sysrouted FROM one or more of the following:
PK23428
APAR is sysrouted TO one or more of the following:
Modules/Macros
Publications Referenced
|
Fix information |
Fixed component name |
WAS NETWRK DEPL |
Fixed component ID |
5630A3601 |
Applicable component levels |
R003 PSY |
UP |
R00A PSY |
UP |
R00H PSY |
UP |
R00I PSY |
UP |
R00P PSY |
UP |
R00S PSY |
UP |
R00W PSY |
UP |
R103 PSY |
UP |
R10A PSY |
UP |
R10H PSY |
UP |
R10I PSY |
UP |
R10P PSY |
UP |
R10S PSY |
UP |
R10W PSY |
UP |
|