colinsurprenant / redstorm

JRuby on Storm
Other
298 stars 56 forks source link

Omit Signature Files From Dependent JARs #108

Closed arielvalentin closed 5 years ago

arielvalentin commented 10 years ago

I am trying to include a JAR that was signed by the author, however the redstorm jar task does not exclude [signature files|http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#Signed%20JAR%20File], which results in an SecurityException:

xml <?xml version="1.0"?>


``` bash```
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:286)
        at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:239)
        at java.util.jar.JarVerifier.processEntry(JarVerifier.java:274)
        at java.util.jar.JarVerifier.update(JarVerifier.java:228)
        at java.util.jar.JarFile.initializeVerifier(JarFile.java:348)
        at java.util.jar.JarFile.getInputStream(JarFile.java:415)
        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:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
colinsurprenant commented 10 years ago

Ok, thanks for reporting and pointing to the relevant docs. I guess it should be as easy as excluding those files when re-jarring, will test.

rtyler commented 10 years ago

FWIW, I hit this with the jruby-gradle/jruby-gradle-storm-plugin work that I've been doing, it's pretty simple in Gradle to handle this, see this shadowjar configuration.

The jruby-gradle-storm-plugin does depend on a divergent redstorm library though