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?