【问题标题】:Joda-time MissingResourceExceptionJoda-time MissingResourceException
【发布时间】: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

The module

【问题讨论】:

  • 嗯,在普通的新java命令行项目中不会发生异常。
  • 嗯,奇怪,我重新启动了它正在运行的服务器,它工作了..

标签: java maven intellij-idea jodatime


【解决方案1】:

我认为它现在已修复.. 昨天重新加载运行此插件的 bukkit/spigot (Minecraft) 服务器后似乎发生了这种情况。重新启动服务器时它会正常工作,但重新加载会破坏它。但今天一切似乎都很好。奇怪,不知道是什么原因造成的。

编辑: 看起来 bukkit 服务器在重新加载时根本不处理资源包。一次重新加载只会破坏使用资源包的所有内容。

【讨论】:

  • 好的,现在又坏了,真奇怪。我认为这是 spigot/bukkit 如何处理插件的问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-04-20
  • 2011-07-03
  • 2020-11-13
  • 1970-01-01
  • 2016-12-26
  • 2012-07-22
  • 2012-02-16
相关资源
最近更新 更多