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.2Comments
APAR is sysrouted FROM one or more of the following: APAR is sysrouted TO one or more of the following: PQ36726 Modules/Macros
|
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
(C) Copyright IBM Corporation 2000, 2006. All Rights Reserved.