[ sisc-Bugs-1750268 ] error handling in contrib/pure-scheme/sexp-xml.scm

"SourceForge.net" <[email protected]> Mon, 09 Jul 2007 03:05:09 -0700
Newsgroups gmane.comp.java.sisc.devel
Message-ID <[email protected]>
Bugs item #1750268, was opened at 2007-07-09 03:05
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1750268&group_id=23735

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: error handling in contrib/pure-scheme/sexp-xml.scm

Initial Comment:
sisc 1.16.6

the bug occurs for example if org.sax can't find the DTD (see below) or if java runs out of memory because of a very large XML-file (47MB, deeply nested and with references to external XML-Entities).

sisc@fahrrad> (sexp-xml:xml->sexp/file "foo.xml")
Error in ->string: <java.lang.NullPointerException>: null
---------------------------
file:/home/johannes/sisc/contrib/pure-scheme/sexp-xml.scm:293:31: <from call to @s2j-conversion::->string>
---------------------------
file:/home/johannes/sisc/contrib/pure-scheme/sexp-xml.scm:266:5: <from call to with/fc>
---------------------------
file:/home/johannes/sisc/contrib/pure-scheme/sexp-xml.scm:234:3: <indeterminate call>
console:314:1: <from call to @sexp-xml::sexp-xml:xml->sexp/file>

i defined all functions from sexp-xml.scm inside the repl and tested only what goes into arg1 of with/fc (lambda (m e) ...) inside function sexp->xml/input-source: i tried to construct (parse xml-reader input-source) manually and received the following error (which lead to the above error when calling from outside):

sisc@fahrrad> (let* ((input-source (java-new <org.xml.sax.input-source> (java-new <java.io.file-reader> (|->jstring| "/home/johannes/du/cvs-modules/traffic-nrw-dav/doc/versorgungsdatei.OLSIM.sample.xml")))) (sa (new-ssax-accumulator)) (xml-reader (get-xml-reader-with-proxy (make-content-handler-proxy sa)))) (parse xml-reader input-source))
Error: #<java java.io.FileNotFoundException java.io.FileNotFoundException: /usr/home/johannes/K2S.dtd (No such file or directory)>
java.io.FileNotFoundException: /usr/home/johannes/K2S.dtd (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at java.io.FileInputStream.<init>(FileInputStream.java:66)
	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:973)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:905)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:872)
	at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:282)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:1021)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at sisc.modules.s2j.Operation.invokeMethod(Unknown Source)
	at sisc.modules.s2j.Operation.doApply(Unknown Source)
	at sisc.nativefun.NativeProcedure.apply(Unknown Source)
	at sisc.exprs.AppEval.eval(Unknown Source)
	at sisc.interpreter.Interpreter.next(Unknown Source)
	at sisc.exprs.AppExp.eval(Unknown Source)
	at sisc.interpreter.Interpreter.interpret(Unknown Source)
	at sisc.interpreter.Interpreter.interpret(Unknown Source)
	at sisc.interpreter.Interpreter.eval(Unknown Source)
	at sisc.data.SchemeThread.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:595)
---------------------------
console:266:296: <from call to parse>


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1750268&group_id=23735

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/