You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/11/17 03:56:44 UTC

DO NOT REPLY [Bug 14623] New: - ErrorDispatcher generates NullPointerException when handling Exceptions

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14623>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14623

ErrorDispatcher generates NullPointerException when handling Exceptions

           Summary: ErrorDispatcher generates NullPointerException when
                    handling Exceptions
           Product: Tomcat 4
           Version: 4.1.12
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: dicej@mailsnare.net


jspError(Exception e) in ErrorDispatcher calls dispatch(null,null,null,e),
which, in turn, calls getString(errCode, args).  getString(String, Object[])
calls the getString(String) method of a java.util.ResourceBundle object which
ultimately results in a Hashtable lookup using errCode as the key.  However,
since the call to dispatch() give errCode as null, this results in a
NullPointerException, the handling of which effectively obscures the original
Exception.

My solution has been to make the call to dispatch() look like this:
dispatch(null,e.getMessage(),null,e), which seems to fix it entirely.  Please
contact me if this is not clear.  Thanks.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>