在我的IDEA中使用Flink,但是运行错误:java.lang.NoSuchMethodError:scala.Predef $ .ArrowAssoc,如何在intelliJ中配置我的scala版本?

时间:2019-01-17 08:45:19

标签: java scala apache-flink

Exception in thread "main" java.lang.NoSuchMethodError: scala.Predef$.ArrowAssoc(Ljava/lang/Object;)Ljava/lang/Object;
    at akka.actor.setup.ActorSystemSetup$$anonfun$apply$1.apply(ActorSystemSetup.scala:36)
    at akka.actor.setup.ActorSystemSetup$$anonfun$apply$1.apply(ActorSystemSetup.scala:36)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
    at scala.collection.AbstractTraversable.map(Traversable.scala:105)
    at akka.actor.setup.ActorSystemSetup$.apply(ActorSystemSetup.scala:36)
    at akka.actor.setup.ActorSystemSetup$.create(ActorSystemSetup.scala:42)
    at akka.actor.RobustActorSystem$.create(RobustActorSystem.scala:55)
    at org.apache.flink.runtime.akka.AkkaUtils$.createActorSystem(AkkaUtils.scala:125)
    at org.apache.flink.runtime.akka.AkkaUtils$.createActorSystem(AkkaUtils.scala:113)
    at org.apache.flink.runtime.akka.AkkaUtils.createActorSystem(AkkaUtils.scala)
    at org.apache.flink.runtime.minicluster.MiniCluster.createRpcService(MiniCluster.java:758)
    at org.apache.flink.runtime.minicluster.MiniCluster.start(MiniCluster.java:257)
    at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:120)

1 个答案:

答案 0 :(得分:0)

如果混合使用Scala版本,通常会出现

java.lang.NoSuchMethodError。例如,它可能是由针对Scala 2.112.12构建的不同依赖关系引起的。请检查所有依赖项以及群集是否使用相同的Scala版本。