aspose file tools*
The moose likes Java in General and the fly likes  invalid LOC header - How to overcome this Exception? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark " invalid LOC header - How to overcome this Exception?" Watch " invalid LOC header - How to overcome this Exception?" New topic
Author

invalid LOC header - How to overcome this Exception?

karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 115

I have deployed my java files & have all the Source files in Place. I need to build my Appln using Ant. When i tried to run it, i get the Following Exception. Could Anyone help me out. Thanks in Advance.


Compiling 20 source files to C:\Documents and Settings\karthik.surya\Desktop\Karthik\Build\BTRHelperClasses
[javac] An exception has occurred in the compiler (1.5.0_08). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
[javac] java.lang.InternalError: jzentry == 0,
[javac] jzfile = 187026544,
[javac] total = 574,
[javac] name = C:\Documents and Settings\karthik.surya\Desktop\Karthik\Helper\cp-jars\poi-3.0.2-beta1-20071204.jar,
[javac] i = 419,
[javac] message = invalid LOC header (bad signature)
[javac] at java.util.zip.ZipFile$3.nextElement(ZipFile.java:429)
[javac] at java.util.zip.ZipFile$3.nextElement(ZipFile.java:415)
[javac] at com.sun.tools.javac.jvm.ClassReader.openArchive(ClassReader.java:1447)
[javac] at com.sun.tools.javac.jvm.ClassReader.list(ClassReader.java:1742)
[javac] at com.sun.tools.javac.jvm.ClassReader.listAll(ClassReader.java:1882)
[javac] at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1905)
[javac] at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1538)
[javac] at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)
[javac] at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:256)
[javac] at com.sun.tools.javac.tree.Tree$TopLevel.accept(Tree.java:382)
[javac] at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:221)
[javac] at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:235)
[javac] at com.sun.tools.javac.comp.Enter.complete(Enter.java:448)
[javac] at com.sun.tools.javac.comp.Enter.main(Enter.java:433)
[javac] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:404)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:592)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:544)
[javac] at com.sun.tools.javac.Main.compile(Main.java:67)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javac] at java.lang.reflect.Method.invoke(Method.java:585)
[javac] at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
[javac] at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:997)
[javac] at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:820)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javac] at java.lang.reflect.Method.invoke(Method.java:585)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.Target.execute(Target.java:357)
[javac] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[javac] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[javac] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
[javac] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[javac] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javac] at java.lang.reflect.Method.invoke(Method.java:585)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.Target.execute(Target.java:357)
[javac] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[javac] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[javac] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[javac] at org.apache.tools.ant.Main.runBuild(Main.java:698)
[javac] at org.apache.tools.ant.Main.startAnt(Main.java:199)
[javac] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[javac] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)


"Learning is a Culture where your Eagerness & Curiosity plays a major Role".
karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 115

This is my Code in Build.xml where i have included all the jars. I think this would be useful for Ranchers to analyse my query more easily.



<path id="project-classpath">
<pathelement path="${env.JAVA_HOME}/lib/tools.jar:
${pp-jarslib}/TreClient.jar:${lib}/TreProductBean.jar:${cp-jarslib}/xerces.jar:
${other-jarslib}/xalan.jar:${other-jarslib}/jfor-0.5.1.jar:
${cp-jarslib}iText.jar:${cp-jarslib}/iTextXML.jar:
${cp-jarslib}/fop.jar:${cp-jarslib}/Armor.jar:${pp-jarslib}/hoststubs.jar:
${pp-jarslib}/corecib.jar:${pp-jarslib}/coreclient.jar:
${lib}/collectionstubs.jar:
${pp-jarslib}/corefiles.jar:${pp-jarslib}/payments.jar:
${lib}/PaymentSimulator_ejb.jar:
${cp-jarslib}/Hpin.jar:${cp-jarslib}/jsse.jar:${other-jarslib}/classes12.zip:
${pp-jarslib}/Treasuryfx.jar:${lib}/RemInterface.jar:
${lib}/Integrator90.jar:
${lib}/PortalEJB.jar:
${lib}/BVInterface.jar:
${other-jarslib}/RemInterfaceLib.jar:${other-jarslib}/FileUpload_Client.jar:
${other-jarslib}/CoreEJBclient.jar:
${cp-jarslib}/javacsv2.0.jar:
${webinf-jarslib}/jsptabcontrol-1.0-b2.jar:
${cp-jarslib}/poi-3.0.2-beta1-20071204.jar:
${cp-jarslib}/imaging.jar:
${cp-jarslib}/Captcha.jar:
${cp-jarslib}/poi-contrib-2.5-final-20040302.jar: ${cp-jarslib}/poi-scratchpad-2.5-final-20040302.jar:${other-jarslib}/PinWrapper.jar:
${cp-jarslib}/log4j-1.2.14.jar:
${cp-jarslib}/ArmorAALCrypto.jar:
${cp-jarslib}/ArmorAALFilter.jar:
${cp-jarslib}/ArmorAAL.jar:
${cp-jarslib}/ArmorSSO.jar:
${cp-jarslib}/ArmorCommon.jar:
${cp-jarslib}/Armori18n.jar:
${cp-jarslib}/Armor.jar:
${cp-jarslib}/ArmorTktGen.jar:
${cp-jarslib}/ArmorTktStub.jar:
${cp-jarslib}/ArmorTktVal.jar:
${cp-jarslib}/intellectlogger-1.0.jar:
${cp-jarslib}/icu4j_3_6_1.jar:
${pp-jarslib}/IntellectOnline.jar:
${pp-jarslib}/TradeHostEJB.jar:
${pp-jarslib}/SubsReportEJB.jar:
${cp-jarslib}/edtftpj-1.5.4.jar:
${cp-jarslib}/mime-util.jar:
${cp-jarslib}Jms.jar:${cp-jarslib}/jms-api.jar:${cp-jarslib}/jms-ra.jar:
"/>

</path>
Raymond Tong
Ranch Hand

Joined: Aug 15, 2010
Posts: 230
    
    2

Did you try to replace the jar file? or with another version ? without beta ??
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

The current POI version is 3.6, released in December last year.
http://poi.apache.org/
karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 115

I'll try replacing the jar file with the Latest Release & let you know about the issue. Thanks Guys.
karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 115

I have removed the Beta version & have tried with the Latest release . Now it's working . Thank you very much David & Raymond.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

thanks mainly to Raymond, I just went to check if POI supports Java 5 (yes, it does)
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Also, you shouldn't mix jar files from different versions, like you're doing with the main POI jar file and the scratchpad/contrib jar files.
karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 115

You are Correct Lester. Mixing jars also causes it to be corrupted resulting in Exception. I'm now working with Java 5. It's working Great. Thanks for your valuable input to Ranchers, Lester.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: invalid LOC header - How to overcome this Exception?