1. 程式人生 > >NoSuchMethodError: scala.Predef$.ArrowAssoc(Ljava/lang/Object;)Ljava/lang/Object

NoSuchMethodError: scala.Predef$.ArrowAssoc(Ljava/lang/Object;)Ljava/lang/Object

Exception in thread "main" java.lang.NoSuchMethodError: scala.Predef$.ArrowAssoc(Ljava/lang/Object;)Ljava/lang/Object;
	at akka.actor.setup.ActorSystemSetup$.$anonfun$apply$1(ActorSystemSetup.scala:39)
	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:39) at akka.actor.ActorSystem$.apply(ActorSystem.scala:289) at akka.actor.ActorSystem$.apply(ActorSystem.scala:264) at org.apache.spark.util.AkkaUtils$.org$apache$spark$util$AkkaUtils$$doCreateActorSystem
(AkkaUtils.scala:142) at org.apache.spark.util.AkkaUtils$$anonfun$1.apply(AkkaUtils.scala:54) at org.apache.spark.util.AkkaUtils$$anonfun$1.apply(AkkaUtils.scala:53) at org.apache.spark.util.Utils$$anonfun$startServiceOnPort$1.apply$mcVI$sp(Utils.scala:1969) at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:141) at org.apache.spark.util.Utils$.startServiceOnPort(Utils.scala:1965) at org.apache.spark.util.AkkaUtils$.createActorSystem(AkkaUtils.scala:56) at org.apache.spark.SparkEnv$.create(SparkEnv.scala:209) at org.apache.spark.SparkContext.<init>(SparkContext.scala:289) at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:54) at com.lcc.spark.Demo.main(Demo.java:26)

原因:使用的scala版本不統一,統一版本就好了

		 <dependency>
            <groupId>com.typesafe.akka</groupId>
            <artifactId>akka-actor_2.10</artifactId>
            <version>2.2.4</version>
        </dependency>

在這裡插入圖片描述

[email protected] scala$ echo $SCALA_HOME
/Users/lcc/soft/scala/scala-2.10.4
[email protected] scala$