You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "hamid.farhadi.nsc" <ha...@gmail.com> on 2010/02/23 12:54:48 UTC

i'm getting org.xml.sax.SAXParseException

hi all,

this is the output:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C:\Documents and Settings\hamit ina>java edu.ncsu.tiaa.gui.GUI
File not found!
 Processing the knowledge base: Put hyper-alert types into the database
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema
document 'newKnowledgeBase.xsd', because 1) could not find the
 document; 2) the document could not be read; 3) the root element of the
document is not <xsd:schema>.
        at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at
org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown
Source)
        at
org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown
Source)
        at
org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown
Source)
        at
org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown
Source)
        at
org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
        at
org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at
edu.ncsu.tiaa.knowledgebase.KnowledgeBase.print(KnowledgeBase.java:313)
        at
edu.ncsu.tiaa.knowledgebase.KnowledgeBase.<init>(KnowledgeBase.java:191)
        at
edu.ncsu.tiaa.alert_collection.AlertCollection.<init>(AlertCollection.java:97)
        at edu.ncsu.tiaa.gui.GUI.createNewProject(GUI.java:986)
        at edu.ncsu.tiaa.gui.GUI.newButtonActionPerformed(GUI.java:1244)
        at edu.ncsu.tiaa.gui.GUI.access$1400(GUI.java:33)
        at edu.ncsu.tiaa.gui.GUI$15.actionPerformed(GUI.java:254)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Warning: org.xml.sax.SAXParseException: schema_reference.4: Failed to
read schema document 'newKnowledgeBase.xsd', because 1) could not
 find the document; 2) the document could not be read; 3) the root
element of the document is not <xsd:schema>.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I dont have the source of the application. now I wanna make sure that my
problem is "1) could not find the document" and is not other two choices
: 2) the document could not be read; 3) the root element of the document
is not <xsd:schema>. I have attached the xsd file. another point is that
the file is in linux format and i'm reading it in windows. i have also
converted it into windows format and i got the same error.

any help is appreciated.
hamid farhadi


Re: i'm getting org.xml.sax.SAXParseException

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Michael Ludwig <mi...@gmx.de> wrote on 02/23/2010 03:35:22 PM:

> hamid.farhadi.nsc schrieb am 23.02.2010 um 15:24:48 (+0330):
> > C:\Documents and Settings\hamit ina>java edu.ncsu.tiaa.gui.GUI
> > File not found!
> >  Processing the knowledge base: Put hyper-alert types into the database
> > org.xml.sax.SAXParseException: schema_reference.4: Failed to read
schema
> > document 'newKnowledgeBase.xsd', because 1) could not find the
> >  document; 2) the document could not be read; 3) the root element of
the
> > document is not <xsd:schema>.
>
> You schema is fine, so you can exclude (3).
>
> You can exclude (2) by writing a simple program reading the file using
> an absolute path and having it run under the same process.
>
> My bet is (1) is your problem.

There would be an IOException that Xerces is catching before emitting this
warning message. Xerces-J 2.9.1 and earlier swallows it. With the current
development stream you can retrieve the root cause for this error (i.e. the
IOException) from the SAXParseException [1].

> > another point is that the file is in linux format and i'm reading it
> > in windows. i have also converted it into windows format and i got the
> > same error.
>
> Should be irrelevant.
>
> --
> Michael Ludwig
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org

[1] http://issues.apache.org/jira/browse/XERCESJ-1124

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Re: i'm getting org.xml.sax.SAXParseException

Posted by Michael Ludwig <mi...@gmx.de>.
hamid.farhadi.nsc schrieb am 23.02.2010 um 15:24:48 (+0330):
> C:\Documents and Settings\hamit ina>java edu.ncsu.tiaa.gui.GUI
> File not found!
>  Processing the knowledge base: Put hyper-alert types into the database
> org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema
> document 'newKnowledgeBase.xsd', because 1) could not find the
>  document; 2) the document could not be read; 3) the root element of the
> document is not <xsd:schema>.

You schema is fine, so you can exclude (3).

You can exclude (2) by writing a simple program reading the file using
an absolute path and having it run under the same process.

My bet is (1) is your problem.

> another point is that the file is in linux format and i'm reading it
> in windows. i have also converted it into windows format and i got the
> same error.

Should be irrelevant.

-- 
Michael Ludwig

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