Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.util.MissingResourceException

 
Mattias Andersson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Eclipse 3.6 and TomCat 7.0.16.
I have two languages implemented in JSF2/ICEFaces.

This is how my faces-config.xml looks:


In the package se.comlink.internationalizatin.resources there are two properties files namely:
messages_en.properties
messages_sv.properties


It seems to be working quite good.
But when I submit a form I get the "java.util.MissingResourceException: Can't find bundle for base name i18n.messages, locale sv"
This error ONLY occurs when browser language is set to sv (swedish).
When language is set to en (english) the error NEVER occurs.

So, any of you have any good ideas?

Thanks!
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18272
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has to do with MessageBundles and I18N. The file it's looking for needs to be named something like "/WEB-INF/classes/se/comlink/internationalization/resources/messages/messages.properties.sv, if my memory is any good.

You should be able to find the exact naming requirements for bundle property files in the JavaDocs for ResourceBundles, though, which is a better place to search than the decrepit halls of my recollection.
 
Mattias Andersson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok.
I will look into it.

But the real strange thing is that my i18n messages are loading as it should when my pages initialized are loaded.
This error I've got only occurs when I submit an ajaxafied form (single submit).
Well... that's what I think anyway
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic