简体   繁体   English

“无法找到基本名称消息的包”错误

[英]“Can't find bundle for base name messages” error

while running 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 specified this: 在我的faces-config中我指定了这个:

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

and I have a directory src\\web\\resources\\msg with the file messages_en.propeties. 我有一个目录src \\ web \\ resources \\ msg,文件messages_en.propeties。

What am I missing? 我错过了什么?

Based on the exception, the locale that the server is looking for is de_CH or failing that, de . 基于异常,服务器正在寻找的语言环境是de_CH或者失败, de If that fails too, then it will look for 'default' language, but what that is, depends on your system settings. 如果那也失败了,那么它会寻找“默认”语言,但这取决于你的系统设置。 So it may never even go to messages_en.properties . 所以它甚至可能永远不会messages_en.propertiesmessages_en.properties You could provide messages.properties instead (without any locale indicator) to serve as a default, if that's what you want. 您可以提供messages.properties (不带任何区域设置指示符)作为默认值,如果这是您想要的。

Also read here for the full explanation of how the locale resolution works: http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/ 另请阅读此处以获取有关区域设置解析如何工作的完整说明: http//java.sun.com/developer/technicalArticles/Intl/ResourceBundles/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到MessageSource的ResourceBundle [messages]:无法找到基本名称消息的包 - ResourceBundle [messages] not found for MessageSource: Can't find bundle for base name messages .MissingResourceException:找不到基本名称的包 - .MissingResourceException: Can't find bundle for base name MissingResourceException - 找不到基本名称的包 - MissingResourceException - Can't find bundle for base name 找不到基本名称的包 - Can't find bundle for base name 找不到基本名称警告的捆绑包 - Can't find bundle for base name Warn MissingResourceException:找不到基本名称的捆绑 - MissingResourceException: Can't find bundle for base name MissingResourceException:找不到基本名称的捆绑 - MissingResourceException: Can't find bundle for base name java.util.MissingResourceException:找不到基本名称消息的bundle,locale en_US - java.util.MissingResourceException: Can't find bundle for base name messages, locale en_US glassfish服务器上的“找不到基本名称消息包,语言环境ar_EG”例外是什么? - What is “Can't find bundle for base name messages, locale ar_EG” exception on glassfish server? java.util.MissingResourceException:找不到基本名称消息包,语言环境en_US Floreant POS - java.util.MissingResourceException: Can't find bundle for base name messages, locale en_US Floreant POS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM