【发布时间】:2016-02-04 20:48:32
【问题描述】:
我来了
java.util.MissingResourceException: Can't find bundle for base name org.joda.time.format.messages, locale en
在下面这段代码中;
DateTime start = new DateTime();
DateTime end = new DateTime(2017, 3, 26, 12, 0, 0, 0);
Interval interval = new Interval(start, end);
Period period = interval.toPeriod();
// This line is causing the exception.
System.out.println(PeriodFormat.getDefault().print(period));
堆栈跟踪的相关部分:
Caused by: java.util.MissingResourceException: Can't find bundle for base name org.joda.time.format.messages, locale en
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source) ~[?:1.8.0_65]
at java.util.ResourceBundle.getBundleImpl(Unknown Source) ~[?:1.8.0_65]
at java.util.ResourceBundle.getBundle(Unknown Source) ~[?:1.8.0_65]
at org.joda.time.format.PeriodFormat.buildWordBased(PeriodFormat.java:217) ~[?:?]
at org.joda.time.format.PeriodFormat.wordBased(PeriodFormat.java:205) ~[?:?]
at org.joda.time.format.PeriodFormat.getDefault(PeriodFormat.java:73) ~[?:?]
我主要使用 Maven 的 Joda Time 2.9.2 和 Intellij IDEA 15.0.1
【问题讨论】:
-
嗯,在普通的新java命令行项目中不会发生异常。
-
嗯,奇怪,我重新启动了它正在运行的服务器,它工作了..
标签: java maven intellij-idea jodatime