PQ60371: JSP TRY/FINALLY NEEDS TO CHECK FOR NULL PAGECONTEXT INSIDE THE FINALLY BLOCK

APAR status
Closed as program error.

Error description
WAS4.0.2
NT/2000
Reviewed PMR and created a simple JSP file to examine the Java s
source code produced by the JSP compiler. As the customer points
out, the finally clause in the _jspService method invokes releas
ePageContet on the _jspxFactory. This finally clause should be c
ommon to all servlet code genertaed from JSP files. And example.
.
        } finally {
            if ( out != null){
                out.flush();
            }
            _jspxFactory.releasePageContext(pageContext);
        }
.
When the customer was able to recreate this problem the pageCont
ext parameter to releasePageContext was null. The implementation
of releasePageContext in org.apache.jasper.runtime assumes that
the pageContext object passed into it is non-null. That assumpti
on results in releasePageContext generating a java.lang.NullPoin
terException. If releasePageContext checked for a null pageConte
xt object before invoking release on it, then this exception wou
ld not occur. I suggest solving this problem by ensuring that Js
pFactoryImpl.relasePageContext be corrected to ignore a null pag
eConext instead of generating the NullPointerException.
Local fix Problem summary
****************************************************************
* USERS AFFECTED: Websphere Application Server Developers      *
*                 using JSP's and sessions.                    *
****************************************************************
* PROBLEM DESCRIPTION: NullPointerException thrown in finally  *
*                      block of service method in jsp.         *
****************************************************************
* RECOMMENDATION:                                              *
****************************************************************
If the pageContext object is set to null and if a method is
invoked on this object in the catch/finally block, namely
releasePageContext, it would throw a NullPointerException.
Problem conclusion
Since method calls were made on null objects,
NullPointerException's were thrown.  Hence, checking for null
objects before making a method call resolved this problem.
Temporary fix
//wasdoc0/apars/pq60371/v4.0.2
Comments
APAR information
APAR number PQ60371
Reported component name WEBSPHERE AE NT
Reported component ID 5630A2201
Reported release 400
Status CLOSED PER
PE NoPE
HIPER NoHIPER
Submitted date 2002-04-22
Closed date 2002-05-01
Last modified date 2002-05-01

APAR is sysrouted FROM one or more of the following:

APAR is sysrouted TO one or more of the following:
PQ36726

Modules/Macros

Fix information
Fixed component name WEBSPHERE AE NT
Fixed component ID 5630A2201

Applicable component levels
R400 PSY    UP


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > General
Operating system(s):
Software version: 400
Software edition:
Reference #: PQ60371
IBM Group: Software Group
Modified date: May 1, 2002