DocumentBuilder : parse(InputStream) throwing IOException

Posted on 2009-02-10
Last Modified: 2012-06-27
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"))




		return b.parse(xml);


Open in new window

Question by:bent27
    1 Comment
    LVL 5

    Accepted Solution

    The exception indicates that the passed InputSource has been closed.
    Check the code that calls your parse method.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now