0

I get nullpointer exception when try to load properties from file.

I read some solution,

  • putting property file next to the class
  • loading with our without using GetClassLoader

No success

see the pic http://1drv.ms/1QIimmg

Load fails, not the access, what did I wrong ?

Thanks for your help in advance.

Cs

Csaba Prog
  • 53
  • 1
  • 1
  • 6
  • @Tunaki, it is not duplicate, it is not about what is the NPE it is about WHY. If you check the screenshot then you can see everything seems to be ok (Inputstream != null) but Inputstream.load throws the NPE when the file is exists and has valid content – Csaba Prog Feb 26 '16 at 05:37
  • I think you've just not initialized the `props` variable. You need a `props = new Properties();` before trying to use it in the constructor. – Michael Anderson Feb 26 '16 at 05:54
  • @MichaelAnderson thanks, what a mistake :( , this post really duplicate, can be deleted ... – Csaba Prog Feb 26 '16 at 06:08

0 Answers0