• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 750
  • Last Modified:

DocumentBuilder : parse(InputStream) throwing IOException

Hi,
I am trying to parse an xml document.  I have attached the code as well as the console containing the exception...


protected Node parse (InputSource xml) throws ParserConfigurationException, SAXException, IOException {
		DocumentBuilder b = bfac.newDocumentBuilder();
		b.setErrorHandler(new SimpleSaxErrorHandler(LOG) {
			public void warning(SAXParseException ex) throws SAXException {
				if (!ex.getMessage().startsWith("Declared encoding"))
					super.warning(ex);
			}
		});
		return b.parse(xml);
	}

Open in new window

console
0
bent27
Asked:
bent27
1 Solution
 
TomLunCommented:
The exception indicates that the passed InputSource has been closed.
Check the code that calls your parse method.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now