java.lang.SecurityException:Manifest 主要属性的无效签名文件摘要
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19002777/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
提问by JustusVL
I have checked the other threads with this problem but their situations and solutions do not apply in my case.
我已经检查了其他线程有这个问题,但他们的情况和解决方案不适用于我的情况。
The program should create a connection between a bluetooth device and the computer, and is supposed to receive data from said device. Therefore I am using libraries needed for the bluetooth connection that themselves contain manifest files. This, I am guessing, is where the problem is occurring.
该程序应在蓝牙设备和计算机之间建立连接,并应从所述设备接收数据。因此,我正在使用本身包含清单文件的蓝牙连接所需的库。我猜,这就是问题发生的地方。
I have already tried using different JDKs but with no success.
我已经尝试过使用不同的 JDK,但没有成功。
Here is the entire error message:
这是整个错误消息:
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.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:345)
at java.util.jar.JarFile.getInputStream(JarFile.java:412)
at sun.misc.URLClassPath$JarLoader.getInputStream(URLClassPath.java:775)
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.access0(URLClassLoader.java:71)
at java.net.URLClassLoader.run(URLClassLoader.java:361)
at java.net.URLClassLoader.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:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.intel.bluetooth.BlueCoveImpl.loadStackClass(BlueCoveImpl.java:358)
at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:454)
at com.intel.bluetooth.BlueCoveImpl.access0(BlueCoveImpl.java:70)
at com.intel.bluetooth.BlueCoveImpl.run(BlueCoveImpl.java:1085)
at java.security.AccessController.doPrivileged(Native Method)
at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1083)
at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1076)
at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
at de.offis.medical.sensor.discovery.linux.bluetooth.DiscoveryBT.<init>(DiscoveryBT.java:50)
at Helper.getDiscoveries(Helper.java:27)
at Main.startSensorDemo(Main.java:31)
at Main.main(Main.java:46)
回答by Jehy
Try removing META-INF folder from jar, adding manifest and signing JAR again, it helped me: http://jehy.ru/articles/2013/12/13/invalid-signature-file-digest-for-manifest-main-attributes/
尝试从 jar 中删除 META-INF 文件夹,再次添加清单并签署 JAR,它帮助了我:http: //jehy.ru/articles/2013/12/13/invalid-signature-file-digest-for-manifest-main-属性/