java resourcebundle properties

Hi, I created properties files inside my development folder. But via Java I can’t find the location to retrieve this bundle with          ResourceBundle.getBundle("MyProp", locale); My locale is correct but it says Can't find bundle for base name MyProp Can someone help me with it please? Kind regards, Steven
2 answers

Hi Steven,
The error ‘Can't find bundle for base name MyProp’ says that your program is not able to access your .properties files. Seems like they are placed in the wrong folder. 

To fix it, either you mention the correct location of .properties file or bring them to src folder of your project.

Whenever you are creating .properties files in Netbeans(IDE), don't create them under the main project, create them under source package of the project. This way Netbeans will itself place your .properties files in the default package and you don't have to worry about such errors :)


If you are in Mendix cloud and if you are creating resourcebundles in runtime, you only have access to tmp folder and not with any other folders. So place it in tmp folder and access it.

Draw back, when you do deployment the tmp folder will be cleared. So, you must create it again.