您好,我使用 weblogic 11g 创建 war 应用程序,我对 joda time 的方法有疑问
new DateTime(int, int, int, int, int, int);
这抛出了 nosuchmethodException
但是当我使用 new DateTime(int, int, int, int, int, int, int);
(one int more) 它工作正常
更新:
DateTime start = new DateTime(1990, 1, 1, 0, 0, 0); this doesnt works
DateTime start = new DateTime(1990, 1, 1, 0, 0, 0, 0); this works
知道问题出在哪里吗? 谢谢
最佳答案
在 Joda-Time 2.0 中添加了具有 5 个和 6 个整数参数的构造函数。 7 个整数参数的构造函数已经存在很长时间了。
检查您的 Joda-Time 版本。
您可能使用的是更早的版本。
更新 针对有关它在 JUnit 中工作但部署在 WebLogic 中时不工作的评论,我只能支持版本参数。
在 WebLogic 中,检查您的 jar(使用 jar -tf
)。在里面寻找旧的 Joda-Time 版本。也许 WebLogic 默认将它们放在那里。或者,如果不在您的 jar 中,请查看 WebLogic 的容器类库。检查您的类路径或 JRE 扩展目录。到处看看,因为,好吧,版本参数是有道理的。 NoSuchMethodError 还会如何发生?
关于java - joda new DateTime(int,int,int,int,int,int)的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7185987/