Error 500
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Pavan_Kale
Posted On:   Wednesday, March 6, 2002 01:50 PM

My application is deployed on Jakarta Tomcat. Sometimes this application does not render a few pages, it throws Error 500 - InternalServletException, NullpointerException..
Could anybody please let me know how do you solve this problem when the session timeout option is set to default.

Re: Error 500

Posted By:   AlessandroA_Garbagnati  
Posted On:   Friday, March 8, 2002 02:32 AM

Pavan,

A NullPointerException is throws when you are trying to use an object that is null.

To avoid that error, you should check if an object is null, before using it:

String pippo = null;
// ... some code

// if pippo hasn't been touched, the following
// line will throw a NullPointerExcrption
String pluto = pippo.toUpperCase();

// you should do something like this:
String pluto;
if (pippo == null) {
pluto = "";
} else {
pluto = pippo.toUpperCase();
}

Is up to you, now, find which is the null object that generates the error.


By the way: this is not a Tomcat specific question...

About | Sitemap | Contact