0
我正在使用apache spark。當我嘗試調試應用程序時,出現以下異常。該項目沒有錯誤。我正在嘗試運行一個簡單的wordcount應用程序。Thread [main](暫停(異常ZipException))
Thread [main] (Suspended (exception ZipException))
owns: JarFile (id=32)
owns: URLClassPath (id=33)
owns: Object (id=34)
ZipFile.read(long, long, long, byte[], int, int) line: not available [native method]
ZipFile.access$1400(long, long, long, byte[], int, int) line: not available
ZipFile$ZipFileInputStream.read(byte[], int, int) line: not available
ZipFile$ZipFileInflaterInputStream.fill() line: not available
ZipFile$ZipFileInflaterInputStream(InflaterInputStream).read(byte[], int, int) line: not available
IOUtils.readFully(InputStream, int, boolean) line: not available
JarFile.getBytes(ZipEntry) line: not available
JarFile.checkForSpecialAttributes() line: not available
JarFile.hasClassPathAttribute() line: not available
JavaUtilJarAccessImpl.jarFileHasClassPathAttribute(JarFile) line: not available
URLClassPath$JarLoader.getClassPath() line: not available
URLClassPath.getLoader(int) line: not available
URLClassPath.getNextLoader(int[], int) line: not available
URLClassPath.getResource(String, boolean) line: not available
URLClassLoader$1.run() line: not available
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
Launcher$AppClassLoader(URLClassLoader).findClass(String) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
LauncherHelper.checkAndLoadMain(boolean, int, String) line: not available
這裏是代碼片段..
SparkConf sparkConf = new SparkConf().setAppName("JavaSparkSQL").setMaster("local");
JavaSparkContext ctx = new JavaSparkContext(sparkConf);
// SQLContext sqlContext = new SQLContext(ctx);
JavaRDD<String> lines = ctx.textFile("file.txt");
JavaRDD<String> words = lines.flatMap(new FlatMapFunction<String, String>() {
public Iterable<String> call(String s) {
System.out.println("hello");
System.out.println(Arrays.asList(s.split(" ")));
return Arrays.asList(s.split(" "));
}
});
該代碼片段似乎沒有在棧跟蹤中被調用...... –
它被調用時,當我在SparkConf行之後打印「hello」關鍵字時,它打印出hello,然後代碼給出異常。 –
是的。但是它不會在您向我們展示的堆棧跟蹤中的任何位置調用! –