• Post Reply Bookmark Topic Watch Topic
  • New Topic

ListResourceBundle and MissingResourceException  RSS feed

 
Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm working on a project that involves loading up a ResourceBundle. More explicitly, I've created a class that extends ListResourceBundle. The class is called PNSResource_en_CA.java. It compiles fine and everything, but the MissingResourceException keeps popping up every time I try to load up the class:

ResourceBundle messages = ResourceBundle.getBundle("parser.PNSResource", Locale.ENGLISH);

All my source files are in package parser. When making this call with or without the "parser" in the string, always results in a MissingResourceException. My IDE is Eclipse. I've been playing around with this one problem for two days. I even tried changing the version of Eclipse. I'm at the end of my rope. What can I do in Eclipse to ensure that the getBundle() method can see the class. I don't know how it can miss it. It's in the same package! Please advise.

Alan
 
Paul Clapham
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How should the getBundle method know that "parser.PNSResource" actually means "PNSResource_en_CA"? I see a reference to English in your code but not a reference to Canada. Presumably "en-CA" is not your default locale either. (I've found that software tends to configure itself as if it were in the US, even when it's in Canada.)
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!