1

I am deploying a war file in webapps folder of tomcat and i am getting following error. What could be the reason for that. i went through couple of forum post but i didn't get any fruitful output.

java.util.zip.ZipException: invalid LOC header (bad signature)

Below is the 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>

2
  • Which line in your build file throws that exception? Commented Aug 5, 2013 at 4:31
  • Images folder in web folder is of 10GB size so when i create the war having that folder, it gives this error, without this folder war gets created successfully. Commented Aug 6, 2013 at 13:10

1 Answer 1

1

Large zip files were not supported until Java 7:

http://blogs.oracle.com/xuemingshen/entry/zip64_support_for_4g_zipfile

via an extension called ZIP64. This is why you cannot deploy the war.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.