Property file is not found and throwing exception?
<p>I am trying to read properties file to fetch the values. But, the code is throwing an exception.</p>

<p>Exception</p>

<pre><code>Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.cisco.installbase.hiveconnector.ReadProperties.getInstance(ReadProperties.java:28)
    at com.cisco.installbase.hiveconnector.MainApp.main(MainApp.java:7)
Caused by: java.lang.NullPointerException
    at java.util.Properties$LineReader.readLine(Properties.java:434)
    at java.util.Properties.load0(Properties.java:353)
    at java.util.Properties.load(Properties.java:341)
    at com.cisco.installbase.hiveconnector.ReadProperties.&lt;init&gt;(ReadProperties.java:16)
    at com.cisco.installbase.hiveconnector.ReadProperties.&lt;init&gt;(ReadProperties.java:12)
    at com.cisco.installbase.hiveconnector.ReadProperties$PropHolder.&lt;clinit&gt;(ReadProperties.java:23)
    ... 2 more
</code></pre>

<p>ReadProperties.java</p>

<pre><code>package com.cisco.installbase.hiveconnector;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.Set;

public class ReadProperties {

    private final Properties props = new Properties();

    private ReadProperties()
    {
        InputStream in = this.getClass().getClassLoader().getResourceAsStream("config.properties");
        try{
            props.load(in);
        }catch(IOException e){
            e.printStackTrace();
        }
    }

    private static class PropHolder{
        private static final ReadProperties INSTANCE = new ReadProperties();
    }

    public static ReadProperties getInstance()
    {
        return PropHolder.INSTANCE;
    }

    public String getProperty(String key)
    {
        return props.getProperty(key);
    }

    public Set&lt;String&gt; getAllPropertyNames()
    {
        return props.stringPropertyNames();
    }

    public boolean containsKey(String key)
    {
        return props.containsKey(key);
    }
}
</code></pre>

<p>the directory structure and location of my prop file</p>

<p><a href="https://i.stack.imgur.com/xgYgk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xgYgk.png" alt="enter image description here"></a></p>

<p>Can someone help me with the location where the property file needs to be put.</p>