Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error reading properties file

 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Method1:
in = this.getClass().getResourceAsStream(fileName);
props = new Properties();
props.load(in);
Method2:
props.load(Thread.currentThread().
getContextClassLoader().
getResourceAsStream(fileName));
both the methods are returning NULLPointerException. Iam not able to locate the properties file usignthe above syntax. any other solution ?
pls help asap.
thanks.
 
Enrico Mannarino
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a quick question: why do you need a property file for this assignment?
Enrico
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have used this code and it works:

/Ren´┐Ż
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic