Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes XML and Related Technologies and the fly likes DocumentBuilder : parse(InputStream) throwing IOException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "DocumentBuilder : parse(InputStream) throwing IOException" Watch "DocumentBuilder : parse(InputStream) throwing IOException" New topic
Author

DocumentBuilder : parse(InputStream) throwing IOException

vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
Hi,
I am trying to parse an xml document. I have attached the code as well as the console containing the exception...








and the exception is :

java.io.IOException: Stream closed
at java.io.StringReader.ensureOpen(StringReader.java:39)
at java.io.StringReader.read(StringReader.java:73)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipString(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(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 org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

Any help is appreciated...

TIA

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18110
    
    8

So your InputSource contains an InputStream which some other code has already read and closed. At least that's my speculation. You don't show the code which produces that InputSource so it's just speculation, though.
vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
Thanks for your help... I just figured out, I'm getting this issue only when I debug, it, if I just run my app, it seems fine.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DocumentBuilder : parse(InputStream) throwing IOException
 
Similar Threads
Java & XML Parsing XML Response String
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element
Sax parser and SSLHandshakeException
Caused by: java.lang.InstantiationException
Out of memory error when opening an XML of size 18 MB