#MissingResourceException while creating a ResourceBundle

6 messages · Page 1 of 1 (latest)

celest smelt
#

I'm trying to create a ResourceBundle Object to retrieve Strings from my properties files at Project/resources/I18N/resource_bundle.
I have 2 properties files, resource_bundle.properties and resource_bundle_fi_FI.properties

This is my code:

private final ResourceBundle bundle;
...
this.bundle = ResourceBundle.getBundle("resources\\I18N\\resource_bundle");

And it gives me the following exception:

java.util.MissingResourceException: Can't find bundle for base name resources\I18N\resource_bundle, locale fi_FI

I get that it cannot find my properties files, but I haven't been able to find a working solution yet.

fallen lintelBOT
#

Hey, @celest smelt!
Please remember to /close this post once your question has been answered!

celest smelt
#

I managed to solve this problem.

#

Literally just changing the baseName to "I18N/MessagesBundle" fixed it.

#

Apparently adding "resources" to the base name caused the exception.