cancel
Showing results for 
Search instead for 
Did you mean: 

Error : java.util.MissingResourceException

Former Member
0 Kudos

Hi Friends,

I had developed one web dynpro application by using Internationalization - I18N of WebDynPro (Java) Application (Blog) but I got one error that is

<b>java.util.MissingResourceException: Can't find bundle for base name com.sap.example.language.lang, locale en_US</b> Actually i created two properties file

1. lang_en.properties

2. lang_ta.properties

I stored this two properties file in this package com.sap.example.language

and this my code in DOInit()

sessionLocale = WDClientUser.getCurrentUser().getLocale();

resourceHandler = ResourceBundle.getBundle("com.sap.example.language.lang",sessionLocale);

}

catch (WDUMException e)

{

e.printStackTrace();

}

wdContext.currentContextElement().setUsername_label(resourceHandler.getString("testview.username"));

wdContext.currentContextElement().setPassword_label(resourceHandler.getString("testview.password"));

How to solve this error?

Guide me.

Advance Thanks,

Balaji

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

1. Place your lang_en.properties, lang_ta.properties in dist/PORTAL-INF/classes

2. In PORTALAPP.XML add this property to your Component config:

<property name="ResourceBundleName" value="lang"/>

3. In your message class use this modified method to get resources:

public static String getString(IPortalComponentRequest request, String key) {

try {

return request.getResourceBundle().getString(key);

} catch (MissingResourceException e) {

return key;

}

}

Former Member
0 Kudos

Hi,

Sorry Friend, i did not get your point clearly, can explain some what briefly,