java.lang.InternalError: jzentry == 0, jzfile = 141476144, total = 41, name = /home/serega/tomcat/webapps/pcc/WEB-INF/lib/pcc-dao.jar, i = 9, message = invalid LOC header (bad signature)

AppFuse JIRA | Sergey Pariev | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Sometimes while redeploing Appfuse application in tomcat 5.x (with reloadable="true" in context.xml) I'm getting the following error in catalina.out : ERROR [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ContextLoader.initWebApplicationContext(182) | Context initialization failed java.lang.InternalError: jzentry == 0, jzfile = 141476144, total = 41, name = /home/serega/tomcat/webapps/pcc/WEB-INF/lib/pcc-dao.jar, i = 9, message = invalid LOC header (bad signature) at java.util.zip.ZipFile$3.nextElement(ZipFile.java:430) at java.util.zip.ZipFile$3.nextElement(ZipFile.java:416) at java.util.jar.JarFile$1.nextElement(JarFile.java:214) at java.util.jar.JarFile$1.nextElement(JarFile.java:213) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingJarResources(PathMatchingResourcePatternResolver.java:322) It can be cured only by restarting tomcat and happens 2 or 3 times a day on regular basis. Futher investigations showed that errors happen then spring context files are loaded (it can be seen from stack trace :)). Workaround ----------------------- Workaround for this problem is to load context xml files from WEB-INF directory instead of jars. It can be accomplished with following changes in web.xml and build.xml : - comment out second config location line in the web-settings.xml to force Spring use only /WEB-INF files : <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/applicationContext-*.xml <!-- classpath*:META-INF/applicationContext-*.xml--> </param-value> </context-param> - add the following lines into the package-web ant task before war task: <copy tofile="${webapp.dist}/applicationContext-service.xml" overwrite="true"> <fileset dir="src/service" includes="**/*-service.xml"/> </copy> <copy tofile="${webapp.dist}/applicationContext-hibernate.xml" overwrite="true"> <fileset dir="src/dao" includes="**/*-hibernate.xml"/> <filterset refid="variables.to.replace"/> </copy> - and add 2 lines inside the package-web's war task : <webinf dir="${webapp.dist}" includes="applicationContext-service.xml"/> <webinf dir="${webapp.dist}" includes="applicationContext-hibernate.xml"/> Below is my modified package-web task : <target name="package-web" depends="compile-web,jsp-2" description="Package WAR"> <propertyfile comment="Build Information" file="${build.dir}/web/classes/build.properties"> <entry key="build.date" type="date" pattern="EEEE MMM dd, yyyy" value="now"/> <entry key="build.time" type="date" pattern="hh:mm:ss a zz" value="now"/> <entry key="build.username" value="${user.name}"/> <entry key="build.computer" value="${env.COMPUTERNAME}"/> <entry key="build.dao.type" value="${dao.type}"/> <entry key="webapp.version" value="${webapp.version}"/> </propertyfile> <!-- If Tomcat 5, uncomment the <dispatcher> elements in filter-mappings --> <if> <or> <isset property="tomcat5"/> <isset property="tomcat5.5"/> </or> <then> <replaceregexp flags="g" file="${webapp.target}/WEB-INF/web.xml" match='&lt;!--dispatcher&gt;' replace='&lt;dispatcher&gt;'/> <replaceregexp flags="g" file="${webapp.target}/WEB-INF/web.xml" match='&lt;/dispatcher--&gt;' replace='&lt;/dispatcher&gt;'/> </then> </if> <echo>Preparing tomcat-context.xml for inclusion in war</echo> <!-- Copy tomcat-context.xml file to context.xml --> <if> <and> <isset property="tomcat5"/> <not><isset property="tomcat5.5"/></not> </and> <then> <copy tofile="${webapp.dist}/context.xml" file="metadata/conf/tomcat-context.xml" overwrite="true"> <filterset refid="db.variables"/> </copy> </then> <elseif> <isset property="tomcat5.5"/> <then> <copy tofile="${webapp.dist}/context.xml" file="metadata/conf/tomcat-context-5.5.xml" overwrite="true"> <filterset refid="db.variables"/> </copy> </then> </elseif> </if> <!-- added --> <copy tofile="${webapp.dist}/applicationContext-service.xml" overwrite="true"> <fileset dir="src/service" includes="**/*-service.xml"/> </copy> <copy tofile="${webapp.dist}/applicationContext-hibernate.xml" overwrite="true"> <fileset dir="src/dao" includes="**/*-hibernate.xml"/> <filterset refid="variables.to.replace"/> </copy> <!-- Copy .properties files in src tree to build/web/classes --> <copy todir="${build.dir}/web/classes"> <fileset dir="src/web"> <include name="**/*.properties"/> <include name="**/*.xml"/> </fileset> </copy> <echo>before war task</echo> <war destfile="${webapp.dist}/${webapp.war}" webxml="${webapp.target}/WEB-INF/web.xml" compress="true"> <fileset dir="${webapp.target}" excludes="**/web.xml,**/*-resources.xml"/> <metainf dir="${webapp.dist}" includes="context.xml"/> <classes dir="${build.dir}/web/classes"> <exclude name="**/database.properties"/> </classes> <lib file="${dist.dir}/${webapp.name}-dao.jar"/> <lib file="${dist.dir}/${webapp.name}-service.jar"/> <webinf dir="web/WEB-INF" includes="*-resources.xml"/> <!-- added --> <webinf dir="${webapp.dist}" includes="applicationContext-service.xml"/> <webinf dir="${webapp.dist}" includes="applicationContext-hibernate.xml"/> <webinf dir="${struts.dir}" includes="*.xml"/> <lib file="${clickstream.jar}"/> <lib dir="${struts.dir}" includes="*.jar"/> <lib dir="${jstl.dir}/lib"> <include name="jstl.jar"/> <include name="standard.jar"/> </lib> <lib dir="${javamail.dir}" includes="*.jar"/> <lib file="${log4j.jar}"/> <lib file="${strutsmenu.jar}"/> <lib dir="${displaytag.dir}" includes="*.jar"/> <lib file="${hibernate.jar}"/> <lib dir="${hibernate.dir}/lib" includes="*.jar" excludes="jta.jar"/> <lib dir="${spring.dir}" includes="*.jar" excludes="*mock.jar"/> <lib file="${sitemesh.jar}"/> <lib dir="${velocity.dir}" includes="*.jar"/> <lib file="${urlrewrite.jar}"/> </war> </target>

    AppFuse JIRA | 1 decade ago | Sergey Pariev
    java.lang.InternalError: jzentry == 0, jzfile = 141476144, total = 41, name = /home/serega/tomcat/webapps/pcc/WEB-INF/lib/pcc-dao.jar, i = 9, message = invalid LOC header (bad signature)
  2. 0

    Sometimes while redeploing Appfuse application in tomcat 5.x (with reloadable="true" in context.xml) I'm getting the following error in catalina.out : ERROR [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ContextLoader.initWebApplicationContext(182) | Context initialization failed java.lang.InternalError: jzentry == 0, jzfile = 141476144, total = 41, name = /home/serega/tomcat/webapps/pcc/WEB-INF/lib/pcc-dao.jar, i = 9, message = invalid LOC header (bad signature) at java.util.zip.ZipFile$3.nextElement(ZipFile.java:430) at java.util.zip.ZipFile$3.nextElement(ZipFile.java:416) at java.util.jar.JarFile$1.nextElement(JarFile.java:214) at java.util.jar.JarFile$1.nextElement(JarFile.java:213) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingJarResources(PathMatchingResourcePatternResolver.java:322) It can be cured only by restarting tomcat and happens 2 or 3 times a day on regular basis. Futher investigations showed that errors happen then spring context files are loaded (it can be seen from stack trace :)). Workaround ----------------------- Workaround for this problem is to load context xml files from WEB-INF directory instead of jars. It can be accomplished with following changes in web.xml and build.xml : - comment out second config location line in the web-settings.xml to force Spring use only /WEB-INF files : <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/applicationContext-*.xml <!-- classpath*:META-INF/applicationContext-*.xml--> </param-value> </context-param> - add the following lines into the package-web ant task before war task: <copy tofile="${webapp.dist}/applicationContext-service.xml" overwrite="true"> <fileset dir="src/service" includes="**/*-service.xml"/> </copy> <copy tofile="${webapp.dist}/applicationContext-hibernate.xml" overwrite="true"> <fileset dir="src/dao" includes="**/*-hibernate.xml"/> <filterset refid="variables.to.replace"/> </copy> - and add 2 lines inside the package-web's war task : <webinf dir="${webapp.dist}" includes="applicationContext-service.xml"/> <webinf dir="${webapp.dist}" includes="applicationContext-hibernate.xml"/> Below is my modified package-web task : <target name="package-web" depends="compile-web,jsp-2" description="Package WAR"> <propertyfile comment="Build Information" file="${build.dir}/web/classes/build.properties"> <entry key="build.date" type="date" pattern="EEEE MMM dd, yyyy" value="now"/> <entry key="build.time" type="date" pattern="hh:mm:ss a zz" value="now"/> <entry key="build.username" value="${user.name}"/> <entry key="build.computer" value="${env.COMPUTERNAME}"/> <entry key="build.dao.type" value="${dao.type}"/> <entry key="webapp.version" value="${webapp.version}"/> </propertyfile> <!-- If Tomcat 5, uncomment the <dispatcher> elements in filter-mappings --> <if> <or> <isset property="tomcat5"/> <isset property="tomcat5.5"/> </or> <then> <replaceregexp flags="g" file="${webapp.target}/WEB-INF/web.xml" match='&lt;!--dispatcher&gt;' replace='&lt;dispatcher&gt;'/> <replaceregexp flags="g" file="${webapp.target}/WEB-INF/web.xml" match='&lt;/dispatcher--&gt;' replace='&lt;/dispatcher&gt;'/> </then> </if> <echo>Preparing tomcat-context.xml for inclusion in war</echo> <!-- Copy tomcat-context.xml file to context.xml --> <if> <and> <isset property="tomcat5"/> <not><isset property="tomcat5.5"/></not> </and> <then> <copy tofile="${webapp.dist}/context.xml" file="metadata/conf/tomcat-context.xml" overwrite="true"> <filterset refid="db.variables"/> </copy> </then> <elseif> <isset property="tomcat5.5"/> <then> <copy tofile="${webapp.dist}/context.xml" file="metadata/conf/tomcat-context-5.5.xml" overwrite="true"> <filterset refid="db.variables"/> </copy> </then> </elseif> </if> <!-- added --> <copy tofile="${webapp.dist}/applicationContext-service.xml" overwrite="true"> <fileset dir="src/service" includes="**/*-service.xml"/> </copy> <copy tofile="${webapp.dist}/applicationContext-hibernate.xml" overwrite="true"> <fileset dir="src/dao" includes="**/*-hibernate.xml"/> <filterset refid="variables.to.replace"/> </copy> <!-- Copy .properties files in src tree to build/web/classes --> <copy todir="${build.dir}/web/classes"> <fileset dir="src/web"> <include name="**/*.properties"/> <include name="**/*.xml"/> </fileset> </copy> <echo>before war task</echo> <war destfile="${webapp.dist}/${webapp.war}" webxml="${webapp.target}/WEB-INF/web.xml" compress="true"> <fileset dir="${webapp.target}" excludes="**/web.xml,**/*-resources.xml"/> <metainf dir="${webapp.dist}" includes="context.xml"/> <classes dir="${build.dir}/web/classes"> <exclude name="**/database.properties"/> </classes> <lib file="${dist.dir}/${webapp.name}-dao.jar"/> <lib file="${dist.dir}/${webapp.name}-service.jar"/> <webinf dir="web/WEB-INF" includes="*-resources.xml"/> <!-- added --> <webinf dir="${webapp.dist}" includes="applicationContext-service.xml"/> <webinf dir="${webapp.dist}" includes="applicationContext-hibernate.xml"/> <webinf dir="${struts.dir}" includes="*.xml"/> <lib file="${clickstream.jar}"/> <lib dir="${struts.dir}" includes="*.jar"/> <lib dir="${jstl.dir}/lib"> <include name="jstl.jar"/> <include name="standard.jar"/> </lib> <lib dir="${javamail.dir}" includes="*.jar"/> <lib file="${log4j.jar}"/> <lib file="${strutsmenu.jar}"/> <lib dir="${displaytag.dir}" includes="*.jar"/> <lib file="${hibernate.jar}"/> <lib dir="${hibernate.dir}/lib" includes="*.jar" excludes="jta.jar"/> <lib dir="${spring.dir}" includes="*.jar" excludes="*mock.jar"/> <lib file="${sitemesh.jar}"/> <lib dir="${velocity.dir}" includes="*.jar"/> <lib file="${urlrewrite.jar}"/> </war> </target>

    AppFuse JIRA | 1 decade ago | Sergey Pariev
    java.lang.InternalError: jzentry == 0, jzfile = 141476144, total = 41, name = /home/serega/tomcat/webapps/pcc/WEB-INF/lib/pcc-dao.jar, i = 9, message = invalid LOC header (bad signature)
  3. 0

    Embedded Tomcat server is throwing exception

    Google Groups | 9 years ago | Abhijit
    java.lang.InternalError: jzentry == 0, jzfile = 48709640, total = 5892, name = E:\gwt\gwt-windows-1.4.61\gwt-dev-windows.jar, i = 3559, message = null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Embedded Tomcat server is throwing exception

    Google Groups | 9 years ago | Abhijit
    java.lang.InternalError: jzentry == 0, jzfile = 48709640, total = 5892, name = E:\gwt\gwt-windows-1.4.61\gwt-dev-windows.jar, i = 3559, message = null
  6. 0

    Tomcat - User - java.util.zip.ZipException: invalid block type

    nabble.com | 9 months ago
    java.lang.InternalError: jzentry == 0, > > jzfile = 118335776, > > total = 2482, > > name = tools\tomcat\4.1.31\temp\jar_cache53708.tmp, > > i = 34, > > message = invalid LOC header (bad signature)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.InternalError

      jzentry == 0, jzfile = 141476144, total = 41, name = /home/serega/tomcat/webapps/pcc/WEB-INF/lib/pcc-dao.jar, i = 9, message = invalid LOC header (bad signature)

      at java.util.zip.ZipFile$3.nextElement()
    2. Java RT
      JarFile$1.nextElement
      1. java.util.zip.ZipFile$3.nextElement(ZipFile.java:430)
      2. java.util.zip.ZipFile$3.nextElement(ZipFile.java:416)
      3. java.util.jar.JarFile$1.nextElement(JarFile.java:214)
      4. java.util.jar.JarFile$1.nextElement(JarFile.java:213)
      4 frames
    3. Spring Core
      PathMatchingResourcePatternResolver.doFindPathMatchingJarResources
      1. org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingJarResources(PathMatchingResourcePatternResolver.java:322)
      1 frame