IncompatibleClassChangeError : Found class scala.collection.mutable.ArrayOps, but interface was expected

673 views
Skip to first unread message

Anuj Mehta

unread,
Dec 13, 2013, 2:56:20 AM12/13/13
to scalate...@googlegroups.com
I had created a simple scala project. Using sbt-assembly I had created a jar that includes class files of both src and test classes.
Now I had placed the jar generated in a new folder and I trying to execute the suite when I encounter this error

Scala version: 2.10.2
ScalaTest Version: 2.10

Dependency declared in build.sbt

libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.0" % "test"


I am getting following exception

E:\Workspace\test_1>scala -cp Solution-test-0.1.jar org.scalatest.tools.Runner -s test.scala.SolutionSuite
java.lang.IncompatibleClassChangeError: Found class scala.collection.mutable.ArrayOps, but interface was expected
        at org.scalatest.tools.Runner$.main(Runner.scala:828)
        at org.scalatest.tools.Runner.main(Runner.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:78)
        at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:24)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:88)
        at scala.tools.nsc.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:78)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:101)
        at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:33)
        at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:40)
        at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:56)
        at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:80)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:89)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)


I am attaching my test suite file for reference. Please guide

Regards,
Anuj
SolutionSuite.scala

Anuj Mehta

unread,
Dec 19, 2013, 12:35:26 AM12/19/13
to scalate...@googlegroups.com
Hi

Kindly help me in resolving this issue?

Regards,
Anuj

Bill Venners

unread,
Dec 19, 2013, 4:56:48 AM12/19/13
to scalate...@googlegroups.com
Hi Anuj,

That sounds like a mismatch between Scala versions. Could part of the class files in your jar be compiled with Scala 2.9 and part with Scala 2.10?

Bill


--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalate...@googlegroups.com
To unsubscribe from this group, send email to
scalatest-use...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest
---
You received this message because you are subscribed to the Google Groups "scalatest-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatest-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Bill Venners
Artima, Inc.
http://www.artima.com
Reply all
Reply to author
Forward
0 new messages