3

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.

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$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)
JustusVL
  • 33
  • 1
  • 1
  • 3
  • You project may not have `manifest`, but `jars` you added in your classpath which are required for your project have `manifest` and the problem could be there in one for the dependent `jars` – Sajan Chandran Sep 25 '13 at 10:50
  • How about describing what you try to achieve and how your scenario looks like? Just googling an exception and stating that the results did not match your problem does not help us in providing a meaningful answer. But even the stacktrace indicates that you are using a jar-file which contains a Manifest. – Matthias Sep 25 '13 at 10:50
  • You're right Mathias, I edited my post. So I am using two bluetooth libraries that each contain manifest files. But I am unsure what to look for. – JustusVL Sep 25 '13 at 11:49

1 Answers1

4

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/

Jehy
  • 4,729
  • 1
  • 38
  • 55