This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 13031 - FATAL ERROR displayed from getDocument() method
Summary: FATAL ERROR displayed from getDocument() method
Status: CLOSED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: _ pkuzel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-06-20 16:45 UTC by Milan Kuchtiak
Modified: 2003-07-02 08:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kuchtiak 2001-06-20 16:45:50 UTC
When parsing xml file with XMLDataObject:getDocument() method - there is no 
possible to catch SAXException without displaying an Exception-Window with the 
message :

----------------------------------------------------------------------------
Wed Jun 20 15:45:50 GMT+02:00 2001: org.openide.loaders.XMLDataObject$2:
#FATAL ERROR "The element type "display-name" must be terminated by the
matching end-tag "</display-name>"."
[nbfs:EQCQBIDEQBnew/WEB-INF/web.xml:237]
org.openide.loaders.XMLDataObject$2: #FATAL ERROR "The element type
"display-name" must be terminated by the matching end-tag
"</display-name>"." [nbfs:EQCQBIDEQBnew/WEB-INF/web.xml:237]
        at
org.openide.loaders.XMLDataObject$ErrorPrinter.message(XMLDataObject.java:1053)

        at
org.openide.loaders.XMLDataObject$ErrorPrinter.fatalError
(XMLDataObject.java:1071)

        at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1089)
        at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError
(XMLDocumentScanner.java:635)

        at
org.apache.xerces.framework.XMLDocumentScanner.abortMarkup
(XMLDocumentScanner.java:684)

        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch
(XMLDocumentScanner.java:1188)

        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome
(XMLDocumentScanner.java:381)

        at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
        at
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:172)

        at org.openide.xml.XMLUtil.parse(XMLUtil.java:183)
        at
org.openide.loaders.XMLDataObject.parsePrimaryFile(XMLDataObject.java:603)

        at
org.openide.loaders.XMLDataObject.getDocument(XMLDataObject.java:473)
        at
org.netbeans.modules.web.context.WebContextObject.checkServlets
(WebContextObject.java:441)

        at
org.netbeans.modules.web.context.WebContextObject.access$100
(WebContextObject.java:76)

        at
org.netbeans.modules.web.context.WebContextObject$1.run
(WebContextObject.java:132)

        at org.openide.util.Task.run(Task.java:124)
[catch] at
org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcessor.java:626)
-------------------------------------------------------------------

This happens usually when IDE is starting - by calling getDocument() method for 
invalid XML Document
Comment 1 _ pkuzel 2001-06-21 10:26:23 UTC
Applied patch:

Index: src/org/openide/loaders/XMLDataObject.java
===================================================================
RCS file: /cvs/openide/src/org/openide/loaders/XMLDataObject.java,v
retrieving revision 1.85
diff -u -b -r1.85 XMLDataObject.java
--- src/org/openide/loaders/XMLDataObject.java  2001/06/16 23:02:44     1.85
+++ src/org/openide/loaders/XMLDataObject.java  2001/06/20 15:30:01
@@ -1101,7 +1101,7 @@
     }
     
     /**
-     * Default ErrorHandler reporting via TopManager.
+     * Default ErrorHandler reporting to log.
      */
     static class ErrorPrinter implements org.xml.sax.ErrorHandler {
         
@@ -1119,13 +1119,7 @@
                 }
             );
                 
-            TopManager.getDefault ().notifyException(
-                new Throwable () {                
-                    public String getMessage () {
-                        return msg;
-                    }
-                }
-            );
+            TopManager.getDefault().getErrorManager().log(msg);
         }
 
         public void error (org.xml.sax.SAXParseException e) {
Comment 2 Martin Schovanek 2001-11-16 13:00:28 UTC
VERIFIED
Comment 3 Quality Engineering 2003-07-02 08:40:12 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.