找不到基本名称/ Bundle,locale en_US的包 [英] Can't find bundle for base name /Bundle, locale en_US

查看:145
本文介绍了找不到基本名称/ Bundle,locale en_US的包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个依赖于JSF的库。

I'm using a library that has a dependency on JSF.

当我尝试运行我的项目时,它会显示以下异常按摩..

When I try to run my project, it show following exception massage..

java.util.MissingResourceException: Can't find bundle for base name /Bundle, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:705)

任何想法?

推荐答案

例外是告诉 Bundle_en_US.properties Bundle_en.properties ,或者至少 Bundle.properties 文件应该在类路径的根目录中,但实际上没有。

The exception is telling that a Bundle_en_US.properties, or Bundle_en.properties, or at least Bundle.properties file is expected in the root of the classpath, but there is actually none.

确保至少有一个提到的文件存在于类路径的根目录中。或者,确保提供正确的包名称。例如,如果捆绑包文件实际上已放置在包 com.example.i18n 中,则需要传递 com.example.i18n。捆绑作为捆绑名称而不是捆绑

Make sure that at least one of the mentioned files is present in the root of the classpath. Or, make sure that you provide the proper bundle name. For example, if the bundle files are actually been placed in the package com.example.i18n, then you need to pass com.example.i18n.Bundle as bundle name instead of Bundle.

如果您正在使用Eclipse 动态Web项目,类路径根由 src 文件夹表示,其中包含所有Java包。如果您正在使用Maven项目,则资源文件的类路径根由 src / main / resources 文件夹表示。

In case you're using Eclipse "Dynamic Web Project", the classpath root is represented by src folder, there where all your Java packages are. In case you're using a Maven project, the classpath root for resource files is represented by src/main/resources folder.

  • Maven and JSF webapp structure, where exactly to put JSF resources

这篇关于找不到基本名称/ Bundle,locale en_US的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆