You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2003/01/29 04:19:10 UTC

DO NOT REPLY [Bug 16527] New: - NullPointerException thrown in SAXParser when ErrorHandler is set to null

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

NullPointerException thrown in SAXParser when ErrorHandler is set to null

           Summary: NullPointerException thrown in SAXParser when
                    ErrorHandler is set to null
           Product: Xerces2-J
           Version: 2.3.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: SAX
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: mrglavas@ece.uwaterloo.ca


The SAXParser will throw a NullPointerException if the ErrorHandler has been 
explicitly set to null by the user, and the parser attempts to report a 
warning, error, or fatalError during a parse. This occurs because the 
ErrorHandlerWrapper doesn't check if it has a null reference to an ErrorHandler 
before invoking its methods. The user is expecting a SAXParseException.

Sample stack trace:
java.lang.NullPointerException
	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError
(ErrorHandlerWrapper.java:215)
	at org.apache.xerces.impl.XMLErrorReporter.reportError
(XMLErrorReporter.java:385)
	at org.apache.xerces.impl.XMLErrorReporter.reportError
(XMLErrorReporter.java:315)
	at org.apache.xerces.impl.XMLScanner.reportFatalError
(XMLScanner.java:1294)
	at 
org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch
(XMLDocumentScannerImpl.java:809)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
(XMLDocumentFragmentScannerImpl.java:348)
	at org.apache.xerces.parsers.DTDConfiguration.parse
(DTDConfiguration.java:539)
	at org.apache.xerces.parsers.DTDConfiguration.parse
(DTDConfiguration.java:595)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
	at org.apache.xerces.parsers.AbstractSAXParser.parse
(AbstractSAXParser.java:1064)
	at com.test2003.SAXTester.main(SAXTester.java:186)

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org