This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes java.util.zip.ZipException: error in opening zip file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "java.util.zip.ZipException: error in opening zip file" Watch "java.util.zip.ZipException: error in opening zip file" New topic
Author

java.util.zip.ZipException: error in opening zip file

sandy sean
Ranch Hand

Joined: Dec 30, 2010
Posts: 69
Hi!

While running ant script for building and running a simple hibernate program i m getting following exception. can anyone guide on this please?

build file output follows:-

Buildfile: build.xml

clean:

init:

compile:
[javac] Compiling 3 source files to E:\prac java progs\hiber\build

run:
[java] java.util.zip.ZipException: error in opening zip file
[java] at java.util.zip.ZipFile.open(Native Method)
[java] at java.util.zip.ZipFile.<init>(ZipFile.java:204)
[java] at java.util.zip.ZipFile.<init>(ZipFile.java:235)
[java] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1028)
[java] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:147)
[java] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.nextElement(AntClassLoader.java:130)
[java] at org.apache.tools.ant.util.CollectionUtils$CompoundEnumeration.nextElement(CollectionUtils.java:196)
[java] at sun.misc.CompoundEnumeration.nextElement(CompoundEnumeration.java:43)
[java] at org.slf4j.LoggerFactory.singleImplementationSanityCheck(LoggerFactory.java:217)
[java] at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:110)
[java] at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
[java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
[java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)
[java] at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:165)
[java] at TestClient.openSession(Unknown Source)
[java] at TestClient.main(Unknown Source)

[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:758)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
[java] java.util.zip.ZipException: error in opening zip file
[java] at java.util.zip.ZipFile.open(Native Method)
[java] at java.util.zip.ZipFile.<init>(ZipFile.java:204)
[java] at java.util.zip.ZipFile.<init>(ZipFile.java:235)
[java] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1028)
[java] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:147)
[java] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.nextElement(AntClassLoader.java:130)
[java] at org.apache.tools.ant.util.CollectionUtils$CompoundEnumeration.nextElement(CollectionUtils.java:196)
[java] at sun.misc.CompoundEnumeration.nextElement(CompoundEnumeration.java:43)
[java] at org.slf4j.LoggerFactory.singleImplementationSanityCheck(LoggerFactory.java:217)
[java] at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:110)
[java] at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
[java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
[java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)
[java] at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:165)
[java] at TestClient.openSession(Unknown Source)
[java] at TestClient.main(Unknown Source)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:758)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
[java] java.util.zip.ZipException: error in opening zip file
[java] at java.util.zip.ZipFile.open(Native Method)
[java] at java.util.zip.ZipFile.<init>(ZipFile.java:204)
[java] at java.util.zip.ZipFile.<init>(ZipFile.java:235)
[java] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1028)
[java] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:147)
[java] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.nextElement(AntClassLoader.java:130)
[java] at org.apache.tools.ant.util.CollectionUtils$CompoundEnumeration.nextElement(CollectionUtils.java:196)
[java] at sun.misc.CompoundEnumeration.nextElement(CompoundEnumeration.java:43)
[java] at org.slf4j.LoggerFactory.singleImplementationSanityCheck(LoggerFactory.java:217)
[java] at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:110)
[java] at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
[java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
[java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)
[java] at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:165)
[java] at TestClient.openSession(Unknown Source)
[java] at TestClient.main(Unknown Source)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:758)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
[java] 31 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.5.0-Final
[java] 31 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
[java] 31 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
[java] 47 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[java] 188 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
[java] 188 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
[java] Warning: Caught exception attempting to use SAX to load a SAX XMLReader
[java] Warning: Exception was: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
[java] Warning: I will print the stack trace then carry on using the default SAX parser
[java] java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
[java] at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:189)
[java] at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:150)
[java] at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
[java] at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)
[java] at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)
[java] at org.dom4j.io.SAXReader.read(SAXReader.java:435)
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1576)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:1520)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:1506)
[java] at TestClient.openSession(Unknown Source)
[java] at TestClient.main(Unknown Source)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:758)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

BUILD SUCCESSFUL
Total time: 1 second


Thanks...
Mahesh Panchananam
Greenhorn

Joined: Jun 30, 2011
Posts: 18
Envt issue, delete all the pre-built jars & classes folders then run ant task. Even I faced the same issue sometimes.

Rgds
Mahesh PS
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.util.zip.ZipException: error in opening zip file
 
Similar Threads
ANT/MySQL JDBC Classloader Problem
Not able to understant object initialisation
Odd exception with Axis 1.4 and ant taskdef
WAS 6.1 not starting with ANT script
java.util.zip.ZipException: error in opening zip file