0
我得到以下異常否認:CreateProcess的錯誤= 5,訪問被試圖SparkLauncher例如,當在Win10
Exception in thread "main" java.io.IOException: Cannot run program "E:\Software\spark-1.6.1\bin\spark-submit.cmd": CreateProcess error=5, Access is denied
at java.lang.ProcessBuilder.start(Unknown Source)
at org.apache.spark.launcher.SparkLauncher.startApplication(SparkLauncher.java:418)
at com.wwa.spark.poc.SimpleAppLauncher.main(SimpleAppLauncher.java:13)
Caused by: java.io.IOException: CreateProcess error=5, Access is denied
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 3 more
我的代碼運行SparkLauncher例子是:
public static void main(String[] args) throws IOException {
SparkAppHandle handle = new SparkLauncher().setAppResource("E:/spark-poc-0.0.1-SNAPSHOT.jar")
.setMainClass("com.wwa.spark.poc.SimpleApp").setMaster("spark://spark1:7077").setConf(SparkLauncher.DRIVER_MEMORY, "2g")
.startApplication();
}
我試着改變spark-submit.cmd文件的權限,但沒有運氣。然後,我試圖確保我的所有Spark安裝都具有正確的權限並授予了運行給所有登錄用戶的權限,但這也導致上面粘貼錯誤。
如果我從命令行運行spark-submit.cmd,它可以很好地工作。