• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't use properties file in EJB project developed in WSAD  RSS feed

 
Joe Cheung
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing an EJB project in WSAD in which I have created a source folder storing all config. and properties files (I have examined the exported EAR file that it cantined these files). However, I found the EJB cannot locate the file. Shown below are the code snippet of loading the properties file "app.properties" with different approaches but all failed:

// Approach 1
final ResourceBundle rb = ResourceBundle.getBundle ("app.properties");

// Approach 2
final ResourceBundle rb = ResourceBundle.getBundle ("/app.properties");

// Approach 3
final ResourceBundle rb = ResourceBundle.getBundle ("app.properties",Locale.getDefault (), ClassLoader.getSystemClassLoader ());

// Approach 4
final ResourceBundle rb = ResourceBundle.getBundle ("/app.properties",Locale.getDefault (), ClassLoader.getSystemClassLoader ());

What's the problem? How can I solve it?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about this:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!