• Post Reply Bookmark Topic Watch Topic
  • New Topic

ServletContext returns NULL

 
Dakshinamurthy Ramachandran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We deployed our application in iPlanet 6.0 on Solaris.
Our report links are routed thru one "intermediate" jsp file for getting the configuration values.
Configuration values are read and kept in application scope in first time invocation of any report, using
application.setAttribute("reports_properties", properties);
and subsequent call to reports will take the config values from application object.
Application is working fine for past one month and the following exception thrown a day back.
java.lang.NullPointerException
at
com.netscape.server.servlet.platformhttp.PlatformServletContext.getAttribute(Unk
nown Source)
at jsp.APPS.maps.common.intermediate._jspService(intermediate.java:119)

The following is the coding snippet used in the "intermediate" jsp file.

if(application.getAttribute("reports_properties") == null)
{
/* Get Values from Reports.properties file */
synchronized(this)
{
properties = new Properties();
FileInputStream file = new FileInputStream("/Reports.properties");
properties.load(file);
file.close();
application.setAttribute("reports_properties", properties);
readTheProperty = true;
}
}
else
{
/* Get Values from session object */
properties = (Properties) application.getAttribute("reports_properties");
}

Please clarify me by any chance "application" object
(ie) application = pageContext.getServletContext();
can be NULL.
Thanks in advance
Murthy.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!