You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2002/07/12 15:16:10 UTC
DO NOT REPLY [Bug 10738] New: -
RequestProcessor Passes Null Reference to log.warn(...)
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: struts-dev@jakarta.apache.org
ReportedBy: glm@hilbertinc.com
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>