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=10738>.
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=10738

RequestProcessor Passes Null Reference to log.warn(...)

           Summary: RequestProcessor Passes Null Reference to log.warn(...)
           Product: Struts
           Version: 1.1 Beta 1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Unknown
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


At line 490 (beginning of the processException(...) method), the
getInternal().getMessage(...) returns a null reference, which is passed to the
log.warn(..) method.  The logger doesn't check for null references and throws a
null pointer reference, which obscures the original problem.

I changed the beginning of that method to check for the null reference as follows:

        // Is there a defined handler for this exception?
        ExceptionConfig config = mapping.findException(exception.getClass());
        if (config == null) {
            String message = getInternal().getMessage("unhandledException",    
                                                  
                                                      exception.getClass());
            if (null != message) {
               log.warn(message);
            }

P.S. I also opened a defect on the logger to tolerate null references.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to