Kalher
Kalher

Reputation: 3653

java.util.MissingResourceException: Can't find bundle for base name ResBundle, locale en_GB

I am receiving following exception while I have created a ResBundle class in same package which extends ListResourceBundle class.

java.util.MissingResourceException: Can't find bundle for base name ResBundle, locale en_GB

My calling code

Locale locale = Locale.getDefault();
ResourceBundle resourceBundle = ResourceBundle.getBundle("ResBundle", locale);

Upvotes: 2

Views: 5989

Answers (1)

ayush
ayush

Reputation: 14588

ResourceBundle.getBundle("ResBundle") 

tells the classloader to load a resource named "ResBundle" with default package (that is, no package). It does NOT mean a resource in the current package that has the referencing class.

So try giving the package path and see if the issue gets resolved.

Upvotes: 7

Related Questions