title: Not able to load properties file in Dynamic web project in Eclipse for Java
body: <p>I've put the properties file in Webcontent folder of my dynamic web project. But, it throws null pointer exception. Here is my code.</p>
  
  <pre><code>    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      InputStream input = classLoader.getResourceAsStream("Resources.properties");
      System.out.println(input);
      Properties properties = new Properties();       
      properties.load(input);     
      System.out.println("MySQL Driver :"+properties.getProperty("mysqlDriver"));
  </code></pre>
  
  <h2>My properties file include</h2>
  
  <pre><code>mysqlDriver = com.mysql.jdbc.Driver
  </code></pre>
  
  <p>I'm getting error at InputStream input = classLoader.getResourceAsStream("Resources.properties"); </p>
  
  <p>The error is </p>
  
  <pre><code>Feb 09, 2016 2:58:50 PM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Servlet.service() for servlet [DatabaseAccess] in context with path  [/iNTU] threw exception
  java.lang.NullPointerException
  at java.util.Properties$LineReader.readLine(Unknown Source)
  at java.util.Properties.load0(Unknown Source)
  </code></pre>