java.lang.SecurityException:Manifest主要属性的签名文件摘要无效

时间:2013-09-25 10:45:19

标签: java eclipse security exception

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

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

我已经尝试过使用不同的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 个答案:

答案 0 :(得分:4)

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