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

查看:39
本文介绍了找不到基本名称/Bundle、语言环境 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.

确保类路径的根目录中至少存在上述文件之一.或者,确保您提供正确的包名称.例如,如果bundle 文件实际上是放在com.example.i18n 包中,那么你需要将com.example.i18n.Bundle 作为bundle 名称传递Bundle.

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.

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

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