Broken class error using Joda time using Scala

I am adding the Joda Time repository to SBT with

libraryDependencies ++= Seq( "joda-time" % "joda-time" % "2.1" ) 

Then I have fun using it like this:

  val ymd = org.joda.time.format.DateTimeFormat.forPattern("yyyyMMdd") ymd.parseDateTime("20121212") 

But, when I compile the project in SBT, I get the nasty:

 [warn] Class org.joda.convert.FromString not found - continuing with a stub. [warn] Caught: java.lang.NullPointerException while parsing annotations in /home/jack/.ivy2/cache/joda-time/joda-time/jars/joda-time-2.1.jar(org/joda/time/DateTime.class) [error] error while loading DateTime, class file '/home/jack/.ivy2/cache/joda-time/joda-time/jars/joda-time-2.1.jar(org/joda/time/DateTime.class)' is broken [error] (class java.lang.RuntimeException/bad constant pool tag 10 at byte 42) 

I tried joda version 2.0 but getting the same error.

+86
scala jodatime sbt
Dec 13 '12 at 9:00
source share
2 answers

Add this dependency:

"org.joda"% "joda-convert"% "1.8.1"

This is an optional joda-time dependency. I had to add it to my own project for the scala compiler to accept working with the joda-time jar.

Your problem seems the same.

Version as during editing, latest versions can be found here

+165
Dec 13
source share

I had a similar problem:

 [warn] Class net.jcip.annotations.NotThreadSafe not found - continuing with a stub. [warn] Caught: java.lang.NullPointerException while parsing annotations in ~/.ivy2-p2/cache/org.opensaml/xmltooling/jars/xmltooling-1.3.4.jar(org/opensaml/xml/util/IDIndex.class) [error] error while loading AttributeMap, class file '~/.ivy2-p2/cache/org.opensaml/xmltooling/jars/xmltooling-1.3.4.jar(org/opensaml/xml/util/AttributeMap.class)' is broken [error] (class java.lang.RuntimeException/bad constant pool index: 0 at pos: 12058) 

Explicitly adding the jcip-annotations-1.0.jar resolved the issue.

+1
Oct 16 '13 at 17:59
source share



All Articles