【问题标题】:Eclipse does not recognize Message Bundle (f:loadBundle error)Eclipse 无法识别消息包(f:loadBundle 错误)
【发布时间】:2017-03-17 12:40:22
【问题描述】:

我正在使用 maven/spring 制作一个项目,但是我遇到了一个恼人的错误,eclipse 无法识别我的消息包,如果我尝试在 eclipse 中启动 weblogic(使用 oracle weblogic 服务器工具),我得到了这个错误消息并且部署被中止:

 Multiple annotations found at this line:
 -config.message not found.
 -Resource bundle config.message cannot be found on classpath

但如果我运行 maven 构建,并在 eclipse 之外启动 weblogic (startWebLogic.cmd) 效果很好

在模板.xhtml 中: <f:loadBundle basename="config.message" var="msg"/>

faces-config.xml:

<application>
    <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
    <locale-config>
        <default-locale>pt_BR</default-locale>
        <supported-locale>en</supported-locale>
    </locale-config>
    <resource-bundle>
        <base-name>config.message</base-name>
        <var>msg</var>
    </resource-bundle>
</application>

有人遇到过这个问题并解决了吗?

【问题讨论】:

  • 如果消息包放在src/main/resources/下。是否存在于项目的Java源码文件夹中?
  • 属性是这样放置的:i.imgur.com/42wRuik.png

标签: java spring eclipse maven weblogic


【解决方案1】:

我刚刚找到了解决方案,这有点可耻... 我删除了 xhtml 模板中的&lt;f: loadBundle basename =" config.message "var =" msg "/&gt;,因为它已经在faces-config.xml 中声明,并且“config.message”实际上并不存在,属性文件与语言代码连接在一起,导致 Eclipse 出现错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-20
    • 2017-05-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-09
    相关资源
    最近更新 更多