NoSuchMethodError when declaring a variable

When using Spark and Scala, I come across a strange error. I have a piece of code that declares a variable:

var offset = 0

This throws the following exception:

java.lang.NoSuchMethodError: scala.runtime.IntRef.create(I)Lscala/runtime/IntRef;
   at my.package.MyClass$class.myMethod(MyClass.scala:5)
   ...

And it points directly to a variable declaration. I am using Scala 2.11.2. Compilation of works. This is a runtime error. When sbt packageI start, I do not receive any warnings about the dependency / version mismatch.

+4
source share

All Articles