title: properties file not found within web application
body: <p>I am trying to invoke a Method present within a JAR file from my Web Application (A simple Servlet Application). Below is the code that method is using for accessing the properties file:</p>
  
  <pre><code>InputStream inputStream = 
              ClassLoader.getSystemClassLoader()
                         .getResourceAsStream("demo.properties");
  
  properties.load(inputStream);
  </code></pre>
  
  <p>When this method is invoked using my Web Application, I am getting this <code>NullPointerException</code>:</p>
  
  <pre class="lang-none prettyprint-override"><code>java.lang.NullPointerException
      at java.util.Properties$LineReader.readLine(Unknown Source)
      at java.util.Properties.load0(Unknown Source)
      at java.util.Properties.load(Unknown Source)
  </code></pre>
  
  <p>Possible reason for this exception is: My Web Application is not able to find the <code>demo.properties</code> file, hence the <code>inputStream</code> is <code>NULL</code> and this exception is thrown.</p>
  
  <p>Please let me know:</p>
  
  <ol>
  <li><p>How to resolve this exception.</p></li>
  <li><p>Do I need to place the properties file manually within my Web Based Application? If yes then where exactly where to place this <code>demo.properties</code> file in my Web Application for resolving this exception.</p></li>
  </ol>