How to fix scala -library.jar error

I'm building a game! Framework application using Play! 2.2.1, sbt 0.13.0, and my local version of scala is 2.10.3.

I ran into the serialVersionUID problem when deserializing a specific file that I inherited from staff to work on this project (I have no idea who created this serialized file (or when)).

My error message when creating on Play !:

Caused by: java.io.InvalidClassException: scala.collection.mutable.WrappedArray$ofRef; local class incompatible: stream classdesc serialVersionUID = 8184381945838716286, local class serialVersionUID = -8707880168089396949

After a long search, I found this patch, which should fix the SI-5046 error:

https://issues.scala-lang.org/browse/SI-5046

I downloaded the scala source code from github for branch 2.10.x and I applied the patch to WrappedArray.scala here: scala / src / library / scala / collection / mutable / WrappedArray.scala

What should I do with this modified source code so that I can use it on my Play! Appendix?

* EDIT # 1:

I followed the links from @Alexey Romanov

I still get the WrappedArray $ ofRef error message when compiling Play, although now this is another error message. Here is what I did:

I rebuilt the scala distribution using ant using:

ant build

ant partialdist

Then on Play! I specified the version of scala to use for SBT and plugins, adding the following to the Build.scala file:

scalaVersion := "2.10.3" autoScalaLibrary := false scalaHome := Some(file("/path_to_my_rebuilt_scala_distribution"))

Now my error message:

Caused by: java.io.InvalidClassException: scala.collection.mutable.WrappedArray$ofRef; incompatible types for field bitmap$0

EDIT # 2:

I am moving down the scala versions, and when I got to 2.9.2, the error about WrappedArray $ ofRef was fixed by applying the patch. Now I get another serialization error for another class:

java.io.InvalidClassException: scala.Symbol; local class incompatible: stream classdesc serialVersionUID = -3681772905693662441, local class serialVersionUID = 7747205442425187939

I will go to scala 2.9.1 and see if I can go to the contents of the file with this version.

* EDIT No. 3:

In scala version 2.9.1-1, I get another serialization error: java.io.InvalidClassException: scala.Tuple2; local class incompatible: stream classdesc serialVersionUID = 3990034604647285925, local class serialVersionUID = 5867822941721784448

, .. scala ?

+4
1

Scala define scalaHome:

scalaHome := Some(file("/path/to/scala/home/"))

. Scala, Play, SBT ?, Play.

EDIT: . , / WrappedArray, Scala, .

( , ( ))

, , . , , , Scala , 2.10.3, . - Scala (, 2.10. *, ) , .

+1

All Articles