Error "Cannot find message for base name"

during the launch of my application, I get the following error:

javax.el.ELException: /view/doi/common/navigation.xhtml: Can't find bundle for base name messages, locale de_CH at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:90) at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) 

In my faces-config, I pointed out the following:

 <resource-bundle> <base-name>messages</base-name> <var>msg</var> </resource-bundle> 

and I have a src \ web \ resources \ msg directory with the messages_en.propeties file.

What am I missing?

+4
source share
1 answer

Based on the exception, the locale the server is looking for is located de_CH or does not work, de . If this fails, then it will look for the default language, but what it is depends on your system settings. Therefore, it may not even go to messages_en.properties . Instead, you can specify messages.properties (without any language indicator), which will be used by default if that is what you want.

Also read here to get a full explanation of how local resolution works: http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/

+4
source

All Articles