0
votes

i've got exception, while running java class from Eclipse:
java.util.MissingResourceException: Can't find bundle for base name dbconfig, locale en_US

Seems that my dbconfig.properties file isn't in classpath.

  1. dbconfig.properties located in root of the project.

  2. Eclipse is ran with VM arguments(in Run configurations-->Arguments menu):
    -Dcom.xxx.db.cfg=dbconfig

  3. resource bundle is retrieved following way: rb=ResourceBundle.getBundle((String)System.getProperties().get("com.xxx.db.cfg"));

How to add reference to this property file in .classpath file?

3
You have to tell us a little more about the structure of your project and also how you are trying to load the properties file from the codewillcodejavaforfood

3 Answers

4
votes

If your 'dbconfig.properties' file is in some folder called 'resources' under your project, Right Click on 'resources'->Build Path->Use as source folder

3
votes

Right-click on your project and choose Build Path-Configure Build Path. This opens a dialog with four tabs for configuring the build path. If your properties file is already within your project is however most likely already on the build path and you are just referencing it incorrectly.

3
votes

resolved by specifying: classpathentry kind="lib" path="dbconfig.properties"