pallavi
pallavi

Reputation: 745

SecurityException:no manifiest section for signature file entry

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)

Upvotes: 5

Views: 8355

Answers (2)

cjaube
cjaube

Reputation: 173

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.

Upvotes: 1

Brett Kail
Brett Kail

Reputation: 33946

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.

Upvotes: 1

Related Questions