我应该设计一个本地化的App,但最后这个错误会返回:
Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name messages, locale fa
一段代码:
ResourceBundle bundle =
ResourceBundle.getBundle("messages",new Locale("fa"));
来自我的项目结构的图像(我现在用类似的错误测试了jsp页面,现在我在使用main方法(TestCalender.java)的类中进行测试):
我看到了类似的问题并测试了他们的答案,但我的错误中没有发现任何变化!
答案 0 :(得分:3)
我发现:
由于我使用Maven而某些配置应添加到Database.SetInitializer(new MigrateDatabaseToLatestVersion<{YourDbContext}, Configuration>());
文件以向pom.xml
目录添加资源。
这就是我的所作所为:
target