当前位置: 首页 > 知识库问答 >
问题:

java.lang.安全性异常:清单主要属性的签名文件摘要无效

容俊豪
2023-03-14

我已经检查了有这个问题的其他线程,但是他们的情况和解决方案不适用于我的情况。

该程序应该在蓝牙设备和计算机之间建立连接,并且应该从所述设备接收数据。因此,我正在使用蓝牙连接所需的库,这些库本身包含清单文件。我猜想,这就是问题发生的地方。

我已经尝试使用不同的JDK,但没有成功。

以下是整个错误消息:

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$2.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.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: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.access$500(BlueCoveImpl.java:70)
at com.intel.bluetooth.BlueCoveImpl$1.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)

共有1个答案

尹辰沛
2023-03-14

尝试从jar中移除META-INF文件夹,添加manifest并再次签名JAR,它帮助了我:http://jehy . ru/articles/2013/12/13/invalid-signature-file-digest-for-manifest-main-attributes/

 类似资料: