views:

55

answers:

3

Hi, 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?

+2  A: 

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.

willcodejavaforfood
A: 

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

sergionni
+2  A: 

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

Adi