简体   繁体   English

akka-kryo-serialization ClassNotFoundException:scala.Enumeration $ Val

[英]akka-kryo-serialization ClassNotFoundException: scala.Enumeration$Val

Sometimes when updating a dependency version for my project, when I would run the project I would get the following error: 有时,当为我的项目更新依赖版本时,当我运行项目时,会出现以下错误:

ERROR 09:31:34:241 apply$mcV$sp - Class could not be loaded and/or registered: scala.Enumeration$Val 
ERROR 09:31:34:247 apply$mcV$sp - exception caught during akka-kryo-serialization startup: java.lang.ClassNotFoundException: scala.Enumeration$Val
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)

I usually got lucky and was able to fix this by tweaking the versions of my dependencies. 我通常很幸运,可以通过调整依赖项的版本来解决此问题。

Until I updated my akka version from 2.3.6 to 2.3.12, specifically akka-contrib which contains akka-cluster, akka-remote and akka-peristance. 直到我将akka版本从2.3.6更新到2.3.12,特别是akka-contrib,其中包含akka-cluster,akka-remote和akka-peristance。

Turns out that the problem was actually occurring during the transition between akka 2.3.8 and 2.3.9. 事实证明,该问题实际上是在akka 2.3.8和2.3.9之间的过渡期间发生的。 Looking at the change log, I found that between these two versions the Scala version was upgraded from 2.11.4 to 2.11.5. 查看更改日志,我发现在这两个版本之间,Scala版本已从2.11.4升级到2.11.5。

My project was building on scala 2.11.4. 我的项目基于scala 2.11.4。 Upgrading to 2.11.5 fixed the problem. 升级到2.11.5可解决此问题。

I couldn't find any help online for this, and lost a couple days trying to figure this out. 我在网上找不到任何帮助,因此花了几天的时间才想出办法。 I'm hoping that this will help someone else out. 我希望这会帮助其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM