TOP

Exception in thread "main" java.lang.SecurityException问题解决方法
2019-04-18 01:24:12 】 浏览:588
Tags:Exception thread " main" java.lang.SecurityException 问题 解决 方法

提交运行spark程序,出现如下 错误::




hadoop@master:/usr/local/hadoop/spark/spark-data$ spark-submit --master spark:192.168.71.128:7077 --class PageRank project.jar
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:284)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:238)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:316)
at java.util.jar.JarVerifier.update(JarVerifier.java:228)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
at java.util.jar.JarFile.getInputStream(JarFile.java:450)
at sun.misc.JarIndex.getJarIndex(JarIndex.java:137)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:675)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:667)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:666)
at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:639)
at sun.misc.URLClassPath$3.run(URLClassPath.java:366)
at sun.misc.URLClassPath$3.run(URLClassPath.java:356)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:355)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:332)
at sun.misc.URLClassPath.getResource(URLClassPath.java:198)
at java.net.URLClassLoader$1.run(URLClassLoader.java:364)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)


打开META-INF目录,将*.SF,*.DSA,*.RSA文件删除,即可。应为有些包有签名,导致错误。

在Linux系统下直接运行:


hadoop@master:/usr/local/hadoop/spark/spark-data$ sudo zip -d project.jar META-INF/*.RSA META-INF/*.DSA META-INF/*.SF
[sudo] hadoop 的密码:
zip warning: name not matched: META-INF/*.RSA
deleting: META-INF/BCKEY.SF
deleting: META-INF/BCKEY.DSA
deleting: META-INF/DUMMY.SF
deleting: META-INF/DUMMY.DSA
deleting: META-INF/DEV.SF
deleting: META-INF/DEV.DSA
hadoop@master:/usr/local/hadoop/spark/spark-data$


即可!!!


Exception in thread "main" java.lang.SecurityException问题解决方法 https://www.cppentry.com/bencandy.php?fid=116&id=219199

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Scala   WordCount 下一篇大数据计算新贵Spark在腾讯雅虎优..