Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] MalformedURLException instead of NPE when trying to Builder.build() from a null InputStream

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Iwan Memruk" <iwan.memruk AT gmail.com>
  • To: XOM-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] MalformedURLException instead of NPE when trying to Builder.build() from a null InputStream
  • Date: Tue, 25 Apr 2006 14:42:06 +0300

Hello,

When I give a null InputStream to Builder.build(), I get a
MalformedURLException which is misleading when debugging the problem:

java.net.MalformedURLException
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumentEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInputSource(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
at nu.xom.Builder.build(Builder.java:1127)
at nu.xom.Builder.build(Builder.java:586)

It would be much easier to find the real cause of the problem if an NPE with
a corresponding message would be thrown.

--
Thanks,
Iwan.



Archive powered by MHonArc 2.6.24.

Top of Page