1

tomcat の webapps フォルダーに war ファイルを展開していますが、次のエラーが発生します。その理由は何でしょうか。私はいくつかのフォーラム投稿を行いましたが、実りある出力は得られませんでした。

java.util.zip.ZipException: 無効な LOC ヘッダー (不正な署名)

以下はbuild.xmlです

<!-- setting classpath -->
<path id="tomcat.class.path">
    <pathelement location="C:/Users/test/Downloads/apache-tomcat-7.0.42-windows-x64/apache-tomcat-7.0.42/lib/servlet-api.jar" />
    <pathelement location="C:/Users/test/Downloads/apache-tomcat-7.0.42-windows-x64/apache-tomcat-7.0.42/lib/jsp-api.jar" />
</path>

    <path id="base.class.path">
    <pathelement location="classes" />
    <pathelement location="lib" />
    <!--new files for paypal -->
    <pathelement location="lib/bcpg-jdk14-138.jar" />
    <pathelement location="lib/bcprov-jdk14-138.jar" />
    <pathelement location="lib/commons-codec-1.3.jar" />
    ....

....

   <property file="build.properties"/>

    <path id="classpath">
        <fileset dir="${lib.dir}"/>
    </path>

    <target name="clean">
        <echo>Cleaning the ${htdocs.webinf.dir} and ${dist.dir} directories</echo>
        <delete dir="${htdocs.dir/WEB-INF}"/>
        <delete dir="${dist.dir}"/> 
    </target>

    <target name="init" depends="clean">
        <echo>Creating the htdocs directory</echo>
        <mkdir dir="${htdocs.dir}/WEB-INF/classes"/>
        <mkdir dir="${htdocs.dir}/WEB-INF/lib"/>
        <mkdir dir="${dist.dir}"/>      
    </target>

    <target name="compile" depends="init">
        <echo>Compile the source files</echo>
        <javac srcdir="${classes.dir}" destdir="${htdocs.dir}/WEB-INF/classes">
            <classpath refid="base.class.path"/>    
            <classpath refid="tomcat.class.path"/>              
        </javac>
    </target>

    <target name="copy" depends="compile">
        <copy todir="${htdocs.dir}/WEB-INF">
            <fileset dir="${tomcat.webinf}/WEB-INF"/>
        </copy>

        <copy todir="${htdocs.dir}/WEB-INF/lib">
            <fileset dir="${lib.dir}">
            </fileset>
        </copy>
    </target>


    <target name="war">
        <echo>Building the war file</echo>
        <war destfile="${dist.dir}/${ant.project.name}.war" webxml="${htdocs.dir}/WEB-INF/web.xml">
            <fileset dir="${htdocs.dir}"/>
        </war>
    </target>

        <target name="deploy_local" depends="war">
        <echo>Deploying .war to local Tomcat</echo>
        <copy todir="${tomcat.dir}/webapps">
            <fileset dir="${dist.dir}">
                <include name="${ant.project.name}.war"/>
            </fileset>
        </copy>
    </target>

4

1 に答える 1