llala
llala

Reputation: 11

MissingResourceException, except the ressource is there

I'm working on an exercise with a programm that implements a GUI with JFrame. The language of the programm can be personalized by using properties that have names like "messages_xy" (xy being the short form for the language).

Now when I start the Java Application, I get a MissingResourceException that says: "Can't find bundle for base name org.jis.name, locale en (...) Caused by NoClassDefFoundError".

The properties file messages_en is in the correct directory, I checked the parameters and they're good, too. The error occurs when the messages_en is called for the first time. This is the whole error message.

Here is the method in which it fails. I didn't write the code, I just have to use it for the exercise so I shouldn't do any changes..

public class Messages implements Serializable {
private static final long serialVersionUID = -3129495340668876130L;

private final String BUNDLE_NAME = "org.jis.messages";

private ResourceBundle RESOURCE_BUNDLE;

public Messages(Locale l) {
    RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, l);
}
(...)}

EDIT: here is the directory path of the source folder, I marked where the Messages class is and where the properties files are.

Upvotes: 0

Views: 41

Answers (1)

llala
llala

Reputation: 11

[SOLVED] My built path was the problem, even though I thought it was set right. I fixed it by adding the right folder to the built path again and now it works.

Upvotes: 1

Related Questions