java.lang.SecurityException:没有用于签名文件条目的清单部分 [英] java.lang.SecurityException: no manifest section for signature file entry

查看:254
本文介绍了java.lang.SecurityException:没有用于签名文件条目的清单部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在其他帖子中尝试过建议,但他们没有帮助我。
当我通过 java -jar -BigJar.jar 运行我的jar时,我收到异常:

I have tried suggestions in other threads but they don't help me. When I run my jar by java -jar -BigJar.jar I receive exception :

线程主java.lang.SecurityException中的异常:没有用于签名fil条目的清单部分edu / iris / Pissures / IfSeismogramMgr / MotionVectorAttributeHelper.class

我的蚂蚁文件是

<project name="USGS VHP" default="help" basedir=".">
    <description>USGS VHP Main Build File</description>

    <property name="root" location="." />
    <property name="classdir" value="classes" />
    <property name="contrib" value="http://volcanoes.usgs.gov/software/contrib" />


    <target name="help">
        <echo>
Available targets:          
help    -- displays this help information
init    --
clean   -- deletes lib/*.jar files
touch   -- touch *.java in source tree
contrib -- download the contrib library (use before building)
build   -- build the USGS codebase (use after checkout *)
        </echo>
    </target>

    <target name="init">
    </target>



    <target name="clean">
        <delete>
            <fileset dir="${root}/lib/" includes="*.jar" />
        </delete>
    </target>

    <target name="touch">
        <touch>
            <fileset dir="${root}/../" includes="**/*.java" />
        </touch>
    </target>



    <target name="contrib" depends="init" description="Download the contrib libraries">
        <mkdir dir="${root}/contrib" />
        <get src="${contrib}/colt.jar" dest="${root}/contrib/colt.jar" />
        <get src="${contrib}/comm.jar" dest="${root}/contrib/comm.jar" />
        <get src="${contrib}/commons-collections-3.2.1.jar" dest="${root}/contrib/commons-collections-3.2.1.jar" />
        <get src="${contrib}/fissuresIDL-1.0.jar" dest="${root}/contrib/fissuresIDL-1.0.jar" />
        <get src="${contrib}/fissuresImpl-1.1.13.jar" dest="${root}/contrib/fissuresImpl-1.1.13.jar" />
        <get src="${contrib}/fissuresUtil-1.0.18.jar" dest="${root}/contrib/fissuresUtil-1.0.18.jar" />
        <get src="${contrib}/forms-1.0.7.jar" dest="${root}/contrib/forms-1.0.7.jar" />
        <get src="${contrib}/jai_codec.jar" dest="${root}/contrib/jai_codec.jar" />
        <get src="${contrib}/jai_core.jar" dest="${root}/contrib/jai_core.jar" />
        <get src="${contrib}/jnlp.jar" dest="${root}/contrib/jnlp.jar" />
        <get src="${contrib}/JSAP-2.1.jar" dest="${root}/contrib/JSAP-2.1.jar" />
        <get src="${contrib}/jtransforms-2.4.jar" dest="${root}/contrib/jtransforms-2.4.jar" />
        <get src="${contrib}/log4j-1.2.13.jar" dest="${root}/contrib/log4j-1.2.13.jar" />
        <get src="${contrib}/looks-2.0.4.jar" dest="${root}/contrib/looks-2.0.4.jar" />
        <get src="${contrib}/mysql.jar" dest="${root}/contrib/mysql.jar" />
        <get src="${contrib}/rrd4j-2.0.5.jar" dest="${root}/contrib/rrd4j-2.0.5.jar" />
        <get src="${contrib}/JavaSeedLite.jar" dest="${root}/contrib/JavaSeedLite.jar" />
        <get src="${contrib}/seedCodec-1.0.6.jar" dest="${root}/contrib/seedCodec-1.0.6.jar" />
        <get src="${contrib}/servlet.jar" dest="${root}/contrib/servlet.jar" />
        <get src="${contrib}/seisFile-1.5.2.jar" dest="${root}/contrib/seisFile-1.5.2.jar" />
        <get src="${contrib}/slf4j-api-1.7.1.jar" dest="${root}/contrib/slf4j-api-1.7.1.jar" />
        <get src="${contrib}/slf4j-log4j12-1.7.1.jar" dest="${root}/contrib/slf4j-log4j12-1.7.1.jar" />
        <get src="${contrib}/javassist.jar" dest="${root}/contrib/javassist.jar" />
        <get src="${contrib}/thymeleaf-2.0.13.jar" dest="${root}/contrib/thymeleaf-2.0.13.jar" />
        <get src="${contrib}/ognl-2.6.7.jar" dest="${root}/contrib/ognl-2.6.7.jar" />
        <get src="${contrib}/oscache-2.1-mod2.jar" dest="${root}/contrib/oscache-2.1-mod2.jar" />
        <get src="${contrib}/seedlink_lite_1.2.1.jar" dest="${root}/contrib/" />
        <get src="${contrib}/seedlink_lite_src_1.2.1.jar" dest="${root}/contrib/" />
        <get src="http://repo1.maven.org/maven2/com/h2database/h2/1.3.173/h2-1.3.173.jar" dest="${root}/contrib/h2.jar" />
    </target>



    <target name="build" depends="init" description="Build USGS codebase">
        <!-- Order is important.  Some projects depend on others. -->
        <ant target="jar" inheritAll="false" antfile="${root}/../Util/build.xml" />
        <ant target="jar" inheritAll="false" antfile="${root}/../Math/build.xml" />
        <ant target="jar" inheritAll="false" antfile="${root}/../Net/build.xml" />
        <ant target="jar" inheritAll="false" antfile="${root}/../Plot/build.xml" />
        <ant target="jar" inheritAll="false" antfile="${root}/../Pinnacle/build.xml" />
        <ant target="jar" inheritAll="false" antfile="${root}/../VDX/build.xml" />
        <ant target="jar" inheritAll="false" antfile="${root}/../Valve3/build.xml" />
        <ant target="jar" inheritAll="false" antfile="${root}/../Earthworm/build.xml" />
        <ant target="jar" inheritAll="false" antfile="${root}/../Winston/build.xml" />
        <ant target="jar" inheritAll="false" antfile="${root}/../Swarm/build.xml" />
    </target>

    <target name="jar" depends="build" description="Create one large jar file">
        <jar destfile="${root}/lib/usgs.jar">
            <fileset includes="**/**.class" dir="${root}/../Util/${classdir}" />
            <fileset includes="**/**.class" dir="${root}/../Earthworm/${classdir}" />
            <fileset includes="**/**.class" dir="${root}/../Math/${classdir}" />
            <fileset includes="**/**.class" dir="${root}/../Net/${classdir}" />
            <fileset includes="**/**.class" dir="${root}/../Pinnacle/${classdir}" />
            <fileset includes="**/**.class" dir="${root}/../Plot/${classdir}" />
            <fileset includes="**/**.class" dir="${root}/../Swarm/${classdir}" />
            <fileset includes="**/**.class" dir="${root}/../Valve3/${classdir}" />
            <fileset includes="**/**.class" dir="${root}/../VDX/${classdir}" />
            <fileset includes="**/**.class" dir="${root}/../Winston/${classdir}" />
        </jar>
    </target>

    <manifest file="lib/MANIFEST.MF">
        <attribute name="Main-Class" value="gov.usgs.swarm.Swarm" />
    </manifest>

    <jar destfile="SwarmMentics.jar" manifest="lib/MANIFEST.MF">
        <zipgroupfileset dir="contrib" includes="*.jar" />
        <zipgroupfileset dir="lib" includes="*.jar" />

        <zipfileset src="contrib/colt.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/comm.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/commons-collections-3.2.1.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/commons-net-3.2.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/fissuresIDL-1.0.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/fissuresImpl-1.1.13.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/fissuresUtil-1.0.18.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/forms-1.0.7.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/h2.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/jai_codec.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/jai_core.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/JavaSeedLite.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/javassist.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/jgoodies-looks-2.5.3.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/jnlp.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/JSAP-2.1.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/jtransforms-2.4.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/log4j-1.2.13.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/looks-2.0.4.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/mysql.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/ognl-2.6.7.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/oscache-2.1-mod2.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/rrd4j-2.0.5.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/seedCodec-1.0.6.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/seedlink_lite_1.2.1.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/seedlink_lite_src_1.2.1.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/seisFile-1.5.2.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/servlet.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/slf4j-api-1.7.1.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/slf4j-log4j12-1.7.1.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="contrib/thymeleaf-2.0.13.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>

        <zipfileset src="lib/earthworm.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/math.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/net.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/pinnacle.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/plot.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/swarm.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/usgs.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/util.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/valve.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/vdx.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
        <zipfileset src="lib/winston.jar">
            <exclude name="**/*.RSA, **/*.SF, **/*.DSA" />
            <exclude name="META-INF/MANIFEST.MF"/>
        </zipfileset>
    </jar>
</project>

如您所见,我从每个jar中排除了RSA,SF和DSA文件以及MANIFEST.MF。

As you see I excluded RSA,SF and DSA files and MANIFEST.MF from each jar.

但它不能帮助我解决这个错误。

But it din't help me with that error.

如果你知道smth请回复。

If you know smth please reply.

谢谢!

推荐答案

好像你可能两次打包罐子。首先使用zipgroupfilesets,然后再使用一系列zipfilesets。

It seems like you might be inlcuding the jars twice. First with the zipgroupfilesets and then again with a series of zipfilesets.

您可以删除zipgroupfilesets。

You could probably remove the zipgroupfilesets.

我相信你的排除也存在问题。
您可以将其更改为:

I believe there is also a problem in your excludes. You could change it to this:

<zipfileset src="contrib/fissuresUtil-1.0.18.jar">
    <exclude name="**/*.RSA" />
    <exclude name="**/*.SF" />
    <exclude name="**/*.DSA" />
</zipfileset>

或者这个:

<zipfileset src="contrib/fissuresUtil-1.0.18.jar" excludes="**/*.RSA,**/*.SF,**/*.DSA"/>

参见 http://ant.apache.org/manual/Types/fileset.html (zipfileset是文件集的一种形式),以获取更多信息。

See http://ant.apache.org/manual/Types/fileset.html (zipfileset is a form of fileset) for more information on that.

另外注意,这样的事情可能会简化一些事情:

On another note, something like this might simplify things a bit:

<jar destfile="SwarmMentics.jar" manifest="lib/MANIFEST.MF">
    <restrict>
        <not>
            <or>
                <name name="**/*.RSA"/>
                <name name="**/*.SF"/>
                <name name="**/*.DSA"/>
            </or>
        </not>
        <archives>
            <zips>
                <fileset dir="contrib" includes="**/*.jar"/>
                <fileset dir="lib" includes="**/*.jar"/>
            </zips>
        </archives>
    </restrict>
</jar>

我在 http://ant.apache.org/manual/Tasks/jar.html 合并档案部分。

这篇关于java.lang.SecurityException:没有用于签名文件条目的清单部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆