Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

While running i got java.lang.SecurityException: Invalid signature file digest for Manifest main attributes #5264

Closed
lukeis opened this issue Mar 4, 2016 · 9 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 5264

We are using the jars 

        <dependency org="org.seleniumhq.selenium" name="selenium-server" rev="2.30.0">
            <exclude module="org.mortbay.jetty" /> 
                        <exclude module="selenium-chrome-driver" />
            <exclude module="selenium-firefox-driver" />
            <exclude module="selenium-ie-driver" />
            <exclude module="selenium-android-driver" />
            <exclude module="selenium-safari-driver" />
            <exclude module="selenium-iphone-driver" /> 
        </dependency>
        <dependency org="org.seleniumhq.selenium" name="selenium-java" rev="2.30.0">
            <exclude module="commons-exec" /> 
            <exclude module="selenium-chrome-driver" />
            <exclude module="selenium-firefox-driver" />
            <exclude module="selenium-ie-driver" />
            <exclude module="selenium-android-driver" />
            <exclude module="selenium-safari-driver" />
            <exclude module="selenium-iphone-driver" /> 
        </dependency>
        <dependency org="org.seleniumhq.selenium" name="selenium-htmlunit-driver" rev="2.29.1"/>
        <dependency org="org.seleniumhq.selenium" name="selenium-remote-driver" rev="2.29.1"/>

and put them together in our own big jar.

The problem is whenever we want to run something,
we got java.lang.SecurityException: Invalid signature file digest for Manifest main
attributes.

I've tried to sign the jar, check there is no RSA, SF,etc in the jar,etc.
Out of ideas, please help!

Reported by emmanuel.joliet on 2013-03-01 17:34:17

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

why are you mismatching the selenium components? you're asking for failure...

this is a completely unsupported configuration, i'm going to close as won't fix as
this wonders off into the realm of personal (hacking) customization.

The recommended dependency inclusion is to merely specify:

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>2.31.0</version>
    </dependency> 

Reported by luke.semerau on 2013-03-01 20:30:08

  • Status changed: WontFix

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Won't fix? Hacking? 
This was the nth attempt (desperate btw) trying to solve the problem. 
The fact is that if i take you recommendation i got the same error.
Quid?

Reported by emmanuel.joliet on 2013-03-02 09:41:55

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

You'll need to explain in more detail then what you are doing and what you are trying
to accomplish. You have provided almost no information, it looks like you're using
the maven build artifacts, but using what? Ivy? Gradle? Something else?
What causes your error? Building? Executing a test? Is there more of a stack trace?

Reported by luke.semerau on 2013-03-02 11:11:43

  • Status changed: NeedsClarification

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Please also provide detailed steps to reproduce the issue

Reported by luke.semerau on 2013-03-02 11:17:26

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

ok, i have packed other jars with selenium jars (resolved with Ivy through nexus!) using
Ant (standard <jar> task!).

 <jar jarfile="${dist}/${fileName}" update="true" duplicate="preserve">
                        <zipgroupfileset dir="${lib}">
                                <include name="compile/*-*.jar" />
                                <!--include name="runtime/*-*.jar" / -->
                        </zipgroupfileset>

                </jar>

Then when i execute a program such as running:

java -cp MyJarsContainingSeleniumJars z.y.x.MyApp

then i've got only that:

/software/jdk1.7.0_04/bin/java -Xmx14g -XX:MaxPermSize=512M -cp conf:/home/agistest/AGIS/dist/AGIS-11.0.0.jar
-Dlog4j.configuration=file:conf/logging.properties -Dhostid=2 -DrunDesc=NIGHTLY_T3_CG_28-02-2013-20:09:38_1
x.y.z.Launcher args
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:341)
       at java.util.jar.JarFile.getInputStream(JarFile.java:406)
       at sun.misc.JarIndex.getJarIndex(JarIndex.java:137)
       at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:668)
       at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:660)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:659)
       at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:632)
       at sun.misc.URLClassPath$3.run(URLClassPath.java:362)
       at sun.misc.URLClassPath$3.run(URLClassPath.java:352)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.misc.URLClassPath.getLoader(URLClassPath.java:351)
       at sun.misc.URLClassPath.getLoader(URLClassPath.java:328)
       at sun.misc.URLClassPath.getResource(URLClassPath.java:194)
       at java.net.URLClassLoader$1.run(URLClassLoader.java:358)
       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:423)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
       at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:480) 

The question is, is there any SF, RSA or any other type of file signed in the Selenium
dist that could cause that???

Thanks for support!

Reported by emmanuel.joliet on 2013-03-02 13:28:38

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Selenium does not include any of those files, possibly one of it's dependencies do.
Either way I think they would be easily viewable in your jar (can you double check
the contents or your jar? or please email me your jar so that I can take a look at
it)

Since to reproduce this requires an ivy file and an ant build.xml of some kind, I'm
not able to easily reproduce this issue. If you can recreate the issue with complete
reproducible steps (sample ivy and build file and possibly java too). Or I could try
to see what is going on with your jar. But likely there is something happening with
one of the many dependencies either in your project or the selenium project that causes
this if you are re-packing the jars. This may help you, but i'm not sure: http://stackoverflow.com/a/9594412/725944

Reported by luke.semerau on 2013-03-04 07:48:20

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Ok, found the problem. One of the library from selenium-server pom is bouncycastle.org
which include /META-INF/BCKEY.DSA file.

Excluding this packages in ivy.xml fix my problem for now.

            <exclude module="bcpkix-jdk15on" />
            <exclude module="bcprov-jdk15on" />

Thanks.
E.

Reported by emmanuel.joliet on 2013-03-04 10:21:45

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Glad you found your problem. 

Reported by luke.semerau on 2013-03-04 13:47:07

  • Status changed: WorkingAsIntended

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:16:55

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant