I am trying to read a properties file using a resource bundle class in java, but it is giving me a exception saying that
java.util.MissingResourceException: Can't find bundle for base name jira, locale en_US
This is how i am coding in java
ResourceBundle labels = ResourceBundle.getBundle("jira");
This is my project structure
What is that missing? I have read through the documentation and it says that no need to give any absolute path as the Resource bundle handles that.
ResourceBundles
are read from the classpath. WEB-INF/conf
is not on the classpath for web applications. Try placing the property file in WEB-INF/classes
.
From the above image it appears you are using Maven to build the project. In that case the property file can be moved into src/main/resources
folder to be copied into classes
during the Maven build.