title: NullPointerException when reading a properties file in Java
body: <p>I am  using the following code to read a properties file:</p>
  
  <pre><code>Properties pro = new Properties();
  InputStream is = Thread.currentThread().getContextClassLoader().
      getResourceAsStream("resources.properties");
  
  pro.load(is);
  </code></pre>
  
  <p>And when I execute the code I'm getting the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
    at java.util.Properties$LineReader.readLine(Properties.java:418)
    at java.util.Properties.load0(Properties.java:337)
    at java.util.Properties.load(Properties.java:325)
    at com.ibm.rqm.integration.RQMUrlUtility.RQMRestClient.getResource(RQMRestClient.java:66)
    at com.ibm.rqm.integration.RQMUrlUtility.RQMRestClient.main(RQMRestClient.java:50)
  </code></pre>
  
  <p>Why am I getting a <code>NullPointerException</code>? And where should I save the <code>resources.properties</code> file?</p>