I have a problem using the joda time library together with JRuby
(1.6.6 and 1.6.5).
It looks like we are using the same version of the library as JRuby
uses (version 2.0 -
I’ve written a failing test - https://github.com/andreasronge/joda_jruby
The JUnit tests works (using JavaEmbedUtils.newRuntimeAdapter()) but
calling it from JRuby fails:
(root) at jrubytest.rb:4
Seems like this should work. Probably a classloader conflict of some
sort? I’d say file a bug.
1.6.5 and 1.6.6 ship with joda time 1.6.2 (although I thought jruby used
jarjar it to a different namespace?)
DateTime didn’t have the constructor that you’re trying to call in your
test code added until version 2.0. Therefore, the 1.6.2 version of the
is earlier in the classpath and gets loaded by the classloader.
Your code works with jruby-head though, which is bundling joda-time 2.0.
Thanks, I’m happy with that good explanation.
Luckily I have access to the source code using the joda library - I
can use another constructor instead.