我正在尝试使用Windows上运行的intellij社区版2018.1在我的机器上运行spark-mllib的协作过滤版本。对于许多没有spark-mllib的脚本,我使用了相同的结构,并且一切运行良好。我只有在导入spark-mllib库时才有问题。
我正在使用的代码是:
var okrating = List[Rating]()
var r = new Random()
for( u <- 1 to 10){
for(p <- 1 to 10){
if(r.nextBoolean()){
var rt = new Rating(u, p, 5*r.nextDouble())
okrating = okrating :+ rt
}
}
}
ratings = sc.parallelize(okrating)
println(ratings.collect().mkString("\n"))
val model = ALS.train(ratings, 10, 100, 0.01)
依赖项是:
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.11</artifactId>
<version>2.4.3</version>
</dependency>
当前错误消息:
19/06/03 18:04:44 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
19/06/03 18:04:44 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS
19/06/03 18:04:45 WARN LAPACK: Failed to load implementation from: com.github.fommil.netlib.NativeSystemLAPACK
19/06/03 18:04:45 WARN LAPACK: Failed to load implementation from: com.github.fommil.netlib.NativeRefLAPACK
Exception in thread "main" org.apache.spark.SparkException: Job aborted due to stage failure: Task 1 in stage 71.0 failed 1 times, most recent failure: Lost task 1.0 in stage 71.0 (TID 515, localhost, executor driver): java.lang.StackOverflowError
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1567)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at scala.collection.immutable.List$SerializationProxy.readObject(List.scala:479)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
...
有任何想法掩盖此错误的根源吗?以及如何乘坐它?
谢谢。