我遇到下面當我試圖做一個火花提交:在Apache的火花not_so_familiar例外/斯卡拉
Exception in thread "main" java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.spark.deploy.SparkSubmit$.launch(SparkSubmit.scala:328)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:75)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
這是一個已知的問題?
感謝和問候,
下面的程序是能夠重現上述錯誤消息:
import org.apache.spark.SparkContext
import org.apache.spark.SparkConf
class anomaly_model(val inputfile: String, val clusterNum: Int, val maxIterations: Int, val epsilon: Double, val scenarioNum: Int, val outputfile: String){
val conf = new SparkConf().setAppName("Anomaly Model")
val sc = new SparkContext(conf)
val data = sc.textFile(inputfile)
def main(args: Array[String]) {
val inputfile = "sqlexpt.txt"
val clusterNum = 5
val maxIterations = 1000
val epsilon = 0.001
val scenarioNum = 10
val outputfile = "output.csv"
val am = new anomaly_model(inputfile, clusterNum, maxIterations, epsilon, scenarioNum, outputfile)
}
}
您需要提供更多的信息,最好用一個最小的例子來說明問題。從堆棧跟蹤中猜測幾乎是不可能的 –