Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problem with joda new DateTime(int,int,int,int,int,int)

Hi I creating war aplication with weblogic 11g and I have problem with joda time's method

new DateTime(int, int, int, int, int, int);

this thrown nosuchmethodException but when I use new DateTime(int, int, int, int, int, int, int);(one int more) it works fine update:

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

Any idea where is problem ? thx

like image 510
hudi Avatar asked Aug 25 '11 06:08

hudi


1 Answers

The constructors with 5 and 6 integer arguments were added in Joda-Time 2.0. The 7 integer argument constructor has been there a long time.

Check your version of Joda-Time.

You may be using an earlier one.

UPDATE In response to the comment about it working in JUnit but not when deployed in WebLogic, I can only stand by the version argument.

In WebLogic, examine your jar (use jar -tf). Look inside for old Joda-Time versions. Perhaps WebLogic put them there by default. Or if not in your jar, look in WebLogic's container class library. Check your classpath, or JRE extensions directory. Look everywhere you can, because, well, the version argument makes sense. How else would a NoSuchMethodError occur?

like image 164
Ray Toal Avatar answered Oct 31 '22 19:10

Ray Toal