title: Cannot work with XML file. InputStream is null
body: <p>What am I doing wrong here? I am getting the error there there is nothing in the input stream when that is not the case. The file is there and it is titled correctly. I want to grab the ip addresses i have put in my XML file. Is there a better way to parse in the file instead of <code>dBuilder.parse(XMLReader.class.getResourceAsStream("C:\\Tools\\CLA\\test.xml"));</code> ?</p>
  
  <p>I am experiencing this exception:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: InputStream cannot be null
      at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
      at com.Intel.ameier.XMLparser.TryXML(XMLparser.java:17)
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>import java.io.IOException;
  import org.xml.sax.*;
  import org.w3c.dom.*;
  import javax.xml.parsers.*;
  
  public class XMLparser {
  
      protected void TryXML() throws ParserConfigurationException, SAXException, IOException{
  
          DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
  
          DocumentBuilder dBuilder = builderFactory.newDocumentBuilder();
          Document document = dBuilder.parse(XMLReader.class.getResourceAsStream("C:\\Tools\\test.xml"));
          document.normalize();
  
          NodeList rootNodes = document.getElementsByTagName("info");
          Node rootNode = rootNodes.item(0);
          Element rootElement = (Element)rootNode;
          NodeList compList = rootElement.getElementsByTagName("computer");
          for(int i = 0;i &lt; compList.getLength(); i++){
  
              Node computer = compList.item(i);
              Element compElement = (Element)computer;
  
              Node theIP = compElement.getElementsByTagName("ipaddress").item(0);
              Element theIpElement = (Element)theIP;
  
              System.out.println("The comptuer ip is : " + theIpElement.getTextContent());
  
  
          }
  
  
      }
  
  
  }
  </code></pre>
  
  <p>XML File:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;info&gt;
      &lt;testsuite&gt;
          &lt;name&gt;&lt;/name&gt;
      &lt;/testsuite&gt;
      &lt;computer&gt;
          &lt;ipaddress&gt;111.11.11.6&lt;/ipaddress&gt;
      &lt;/computer&gt;
      &lt;computer&gt;
          &lt;ipaddress&gt;111.11.11.5&lt;/ipaddress&gt;
      &lt;/computer&gt;
      &lt;computer&gt;
          &lt;ipaddress&gt;111.11.11.3&lt;/ipaddress&gt;
      &lt;/computer&gt;
  &lt;/info&gt;
  </code></pre>