• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error reading properties file  RSS feed

 
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
Boost this thread!