cancel
Showing results for 
Search instead for 
Did you mean: 

java.util.MissingResourceException: Can't find resource for bundle java.uti

Former Member
0 Kudos

I am using the following blog to develop a webdynpro application for internationalisation.

I get the following error when I click on the show message button.

java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key greetings

I have created a .properties file by typing the code for it in notepad and then saving it as a .properties file.And then I imported the saved file on my desktop in the package explorer. Is this the right way.

Accepted Solutions (1)

Accepted Solutions (1)

former_member214651
Active Contributor
0 Kudos

Hi Anzar,

Please check if you have added the file under the path Resource->src->packages. Also check in the code if u r providing the path from which the bundle should be taken.

Regards,

Poojith MV

Answers (3)

Answers (3)

Former Member
0 Kudos

hahahaha

Former Member
0 Kudos

Hi Anzar,

Place your .properties file under src -> packages -> x -> y -> z, where x.y.z is the package name.

So now to initialize the Resource Bundle you should use

ResourceBundle bundle = ResourceBundle.getBundle("x.y.z");

Hope this helps you.

Former Member
0 Kudos

Freinds

It is getting the bundle.I checked that .But it is not able to get the resource for the bundle ie. key "farewell"

I have written the MessagesBundle.properties file like this .Is it right?

<dd># MessagesBundle.properties

<dd># <key>=<value>

<dd>greetings = Hello.

<dd>farewell = Goodbye.

<dd>inquiry = How are you?.

and the other one as

<dd># MessagesBundle_en_US.properties

<dd># <key>=<value>

<dd>greetings = Hello.

<dd>farewell = Goodbye.

<dd><inquiry = How are you?.<br>

I think the problem is somewhere here in these files.

My code is as follows:

IWDMessageManager mgr= wdComponentAPI.getMessageManager();

String language;

String country;

Locale currentlocale;

ResourceBundle messages;

currentlocale= new Locale(wdContext.currentContextElement().getLanguageCode(),wdContext.currentContextElement().getCountryCode());

messages=ResourceBundle.getBundle("MessagesBundle",currentlocale);

mgr.reportException(messages.getString("greetings"),false);

mgr.reportException(messages.getString("inquiry"),false);

mgr.reportException(messages.getString("farewell"),false);

Edited by: anzar naik on Apr 22, 2010 6:12 AM

Former Member
0 Kudos

Hi,

Please have a look at this thread,

- Saravanan K