Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SecurityException:no manifiest section for signature file entry

Tags:

java

jar

ant

I have all jars in my lib folder but i dont know which jars are signed it contains many selenium jars.my build.xml is:

        <jar basedir="bin" destfile="build/xpath.jar">
        <zipgroupfileset dir="lib" includes="*.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA"/>
            </zipgroupfileset>
        </jar>

but getting the following exception when i use it into another project:

Exception in thread "main" java.lang.SecurityException: no manifiest section for signature file entry org/bouncycastle/asn1/ocsp/ResponderID.class at sun.security.util.SignatureFileVerifier.verifySection(SignatureFileVerifier.java:392) at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:249)

like image 670
pallavi Avatar asked Nov 04 '22 01:11

pallavi


2 Answers

Additional signing metadata is included in META-INF/MANIFEST.MF. I expect the MANIFEST.MF from one of the signed JARs is being included in your aggregate xpath.jar. Try also excluding MANIFEST.MF files.

like image 153
Brett Kail Avatar answered Nov 09 '22 16:11

Brett Kail


Something like this might work for you.

<jar destfile="build/xpath.jar" basedir="bin">
    <restrict>
        <not>
            <or>
                <name name="**/*.RSA"/>
                <name name="**/*.SF"/>
                <name name="**/*.DSA"/>
            </or>
        </not>
        <archives>
            <zips>
                <fileset dir="lib" includes="**/*.jar"/>
            </zips>
        </archives>
    </restrict>
</jar>

I adapted this from the example at http://ant.apache.org/manual/Tasks/jar.html under the "Merging archives" section.

like image 33
cjaube Avatar answered Nov 09 '22 17:11

cjaube