spark遇到的坑
一。
提示内存不足
在代码里面添加set("spark.testing.memory","512000000")内存容量
val conf :SparkConf = new SparkConf().setAppName("SparkWordCount").setMaster("local[1]").set("spark.testing.memory","512000000")
二。
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.9.6
修改下pom文件,变成下面的
<dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka_2.11</artifactId> <version>2.0.0</version> <exclusions> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.6.6</version> </dependency> <dependency>
三。Exception in thread "main" java.lang.NoSuchMethodError: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less
scala版本不统一造成的。
spark本身会带这scala。这个时候就需要看看这里面scala版本是多少。
怎么看呢?启动spark shell的时候会提示
下载安装一个相同版本的scala就可以了。记得在idea中重新配置一下/