Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Can't find property file when using ResourceBundle.getBundle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Can't find property file when using ResourceBundle.getBundle

Denis St-Amour
Greenhorn

Joined: Jun 02, 2011
Posts: 6
Hi,

I'm trying to figure out what components I need for Java Internationalization: Localization with ResourceBundles. When my application deploys (using Weblogic 10.3) and tries to locate the property file it returns the following error: java.util.MissingResourceException: Can't find bundle for base name Messages, locale en

I have my property files in the correct classpath WEB-INF/classes/Messages_en.properties and nothing seems to be wrong with my ResourceBundle.getBundle. Why can't it find the file? Is there something I forgot to include?


java.util.*;

Locale locale = new Locale("en");

ResourceBundle rb = ResourceBundle.getBundle("Messages", locale);

System.out.println(rb.getString("invalidUser"));




Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Please do not ask the same question in more than one topic.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't find property file when using ResourceBundle.getBundle
 
Similar Threads
Help with I18N
Beginning locales ...
loading issue for message.propeprty file
Problem finding property file with Resource Bundle
Unable to access Property file