I am getting the below ERROR.
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 org.apache.qpid.example.jmsexample.hello.Hello.runTest(Hello.java:29)
at org.apache.qpid.example.jmsexample.hello.Hello.main(Hello.java:16)
My code is :
Properties properties = new Properties();
properties.load(this.getClass().getResourceAsStream("C:/Users/xxx/Documents/workspace-sts-3.8.3.RELEASE/hello.properties"));
Now ititially it looks like the file is missing or something like that.
So I added a check.
File f = new File("C:/Users/xxx/Documents/workspace-sts-3.8.3.RELEASE/hello.properties");
if(f.exists()) {
System.out.println("File exists");
}
else {
System.out.println("File DOES NOT exists");
}
This yields are result of :
File exists
So Im all out of options as to what else is missing. The file definitely exists and is properly populated. What else could I be missing ?