线程“main”中的异常java.lang.SecurityException:Manifest主要属性的签名文件摘要无效 [英] Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

查看:342
本文介绍了线程“main”中的异常java.lang.SecurityException:Manifest主要属性的签名文件摘要无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Exception in thread "main" java.lang.SecurityException: Invalid signature file d                    igest for Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVeri                    fier.java:240)
        at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier                    .java:193)
        at java.util.jar.JarVerifier.processEntry(JarVerifier.java:262)
        at java.util.jar.JarVerifier.update(JarVerifier.java:216)
        at java.util.jar.JarFile.initializeVerifier(JarFile.java:341)
        at java.util.jar.JarFile.getInputStream(JarFile.java:406)
        at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:75                    2)
        at sun.misc.Resource.cachedInputStream(Resource.java:77)
        at sun.misc.Resource.getByteBuffer(Resource.java:160)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:436)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:480)

我收到这个错误,我想知道是否有人可以告诉我是什么导致这个。这是我的项目的痘文件的快照。任何帮助将不胜感激。

Hi i am getting this error and i was wondering if anybody could tell me what was causing this.This is the snapshot of pox file of my project. Any help would be appreciated.

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.jcraft</groupId>
        <artifactId>jsch</artifactId>
        <version>0.1.50</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.29</version>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.3-1101-jdbc41</version>
    </dependency>
    <dependency>
        <groupId>org.objectweb.joram</groupId>
        <artifactId>jftp</artifactId>
        <version>1.52</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>2.2</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <artifactSet>
                            <excludes>
                                <exclude>junit:junit</exclude>
                                <exclude>org.apache.maven:lib:tests</exclude>
                            </excludes>
                        </artifactSet>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>


推荐答案

上网几个小时后,仍无法上网找到解决方案,我偶然发现了解决我问题的这个命令:

After surfing the internet for hours, and still unable to find the solution, I stumbled upon this command which SOLVED my problem:

zip -d yourjar.jar 'META-INF/.SF' 'META-INF/.RSA' 'META-INF/*SF'

此命令撕裂关闭以前的罐子的签名文件,然后签署后你就找不到错误了。

This command rips off the signature files for the previous jars, and then once you sign it you'l find no error.

这篇关于线程“main”中的异常java.lang.SecurityException:Manifest主要属性的签名文件摘要无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆