简体   繁体   English

乔达时报MissingResourceException

[英]Joda-time MissingResourceException

I'm getting a 我正在

java.util.MissingResourceException: Can't find bundle for base name org.joda.time.format.messages, locale en

in the following piece of code; 在下面的代码中;

    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));

Relevant part of the stack trace: 堆栈跟踪的相关部分:

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) ~[?:?]

I'm using Joda Time 2.9.2 and Intellij IDEA 15.0.1 with mainly Maven 我主要在Maven中使用Joda Time 2.9.2和Intellij IDEA 15.0.1

The module 模块

I think it is fixed now.. Yesterday it appeared to happen after reloading the bukkit/spigot (Minecraft) server this plugin was running on. 我认为它现在已修复。。昨天似乎在重新加载运行此插件的bukkit / spigot(Minecraft)服务器后发生。 It would work fine when restarting the server, but a reload would break it. 重新启动服务器时,它可以正常工作,但是重新加载会破坏它。 But today it just all seems to work fine. 但是今天一切似乎都正常。 Strange, no idea what caused it. 奇怪,不知道是什么原因造成的。

EDIT: It appears a bukkit server just doesn't handle resource bundles when reloading well at all. 编辑:看来,bukkit服务器在完全重新加载时根本无法处理资源包。 One reload just breaks everything wich uses resource bundles. 一次重新加载只会破坏所有使用资源包的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM