Project

General

Profile

Bug #522

NullPointer exception if Request doesn't specify a value for "action" parameter

Added by Matthew Brooke over 17 years ago. Updated over 17 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
metacat
Target version:
Start date:
06/06/2002
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
522

Description

If Request doesn't specify a value for the "action" parameter, Tomcat throws a
NullPointer exception.

Example:
Since the status bar has been added to Morpho (see bug #358), Morpho now tries
to connect to Metacat periodically to test if a connection is available. Each
time a connection is attempted (with no "action" specified), a nullpointer
exception appears in the tomcat output window.

Notes:
When metacat servlet was originally written, the HTTPRequest functionality was
originally buggy in tomcat, so as a workaround, request data was passed to
other methods using an array. When an "action" parameter is not passed to the
servlet in the request, the resulting array has zero length, so the method
that receives it throws a nullpointer exception.

A short-term fix would therefore be to check for a missing "action" value
and/or zero-lenght arrays; however, a better long-term fix would be to re-
write the servlet to pass references to the HTTPRequest object instead of
arrays.

History

#1 Updated by Jing Tao over 17 years ago

In MetaCatServlet class, code for handling request param is empty was added.
So if the pramater is empty, it wouldn't throw an exception.

#2 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 522

Also available in: Atom PDF