java.util.zip.ZipException: ZipFile closed

Oracle Community | 636717 | 9 years ago
  1. 0

    Deploying Ear file UI vs command Line

    Oracle Community | 9 years ago | 636717
    java.util.zip.ZipException: ZipFile closed
  2. 0

    User code opens an input stream from a jar file first. Then logback auto config loads the configuration file from the same jar. User code will get the following exception when read the input stream later. {code title="Stack Trace"} java.util.zip.ZipException: ZipFile closed at java.util.zip.ZipFile.ensureOpenOrZipException(ZipFile.java:413) at java.util.zip.ZipFile.access$1100(ZipFile.java:29) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:445) at java.io.FilterInputStream.read(FilterInputStream.java:116) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) at java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at java.io.BufferedReader.readLine(BufferedReader.java:299) at java.io.BufferedReader.readLine(BufferedReader.java:362) {code} {code title="Reproduce"} InputStream resourceAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(logLocation); BufferedReader reader = new BufferedReader(new InputStreamReader(resourceAsStream)); final Logger logger = LoggerFactory.getLogger(LogbackBugReproduce.class); logger.debug(reader.readLine()); {code} It looks like in ch.qos.logback.core.joran.GenericConfigurator.doConfigure(URL url) method: urlConnection.setDefaultUseCaches(false); InputStream in = urlConnection.getInputStream(); doConfigure(in); in.close(); The input stream is associated with the same zip file instance of the users. Then close the input stream will close the zip file that user currently is using. After changing it to: urlConnection.setUseCaches(false); InputStream in = urlConnection.getInputStream(); doConfigure(in); in.close(); The input stream is associated with a different zip file instance. Then close the input stream will not affect the zip file used by the user code.

    QOS.ch JIRA | 7 years ago | tomliliu
    java.util.zip.ZipException: ZipFile closed
  3. 0

    User code opens an input stream from a jar file first. Then logback auto config loads the configuration file from the same jar. User code will get the following exception when read the input stream later. {code title="Stack Trace"} java.util.zip.ZipException: ZipFile closed at java.util.zip.ZipFile.ensureOpenOrZipException(ZipFile.java:413) at java.util.zip.ZipFile.access$1100(ZipFile.java:29) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:445) at java.io.FilterInputStream.read(FilterInputStream.java:116) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) at java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at java.io.BufferedReader.readLine(BufferedReader.java:299) at java.io.BufferedReader.readLine(BufferedReader.java:362) {code} {code title="Reproduce"} InputStream resourceAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(logLocation); BufferedReader reader = new BufferedReader(new InputStreamReader(resourceAsStream)); final Logger logger = LoggerFactory.getLogger(LogbackBugReproduce.class); logger.debug(reader.readLine()); {code} It looks like in ch.qos.logback.core.joran.GenericConfigurator.doConfigure(URL url) method: urlConnection.setDefaultUseCaches(false); InputStream in = urlConnection.getInputStream(); doConfigure(in); in.close(); The input stream is associated with the same zip file instance of the users. Then close the input stream will close the zip file that user currently is using. After changing it to: urlConnection.setUseCaches(false); InputStream in = urlConnection.getInputStream(); doConfigure(in); in.close(); The input stream is associated with a different zip file instance. Then close the input stream will not affect the zip file used by the user code.

    QOS.ch JIRA | 7 years ago | tomliliu
    java.util.zip.ZipException: ZipFile closed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SBT reload fails on SNAPSHOT which are republished locally *while SBT runs*

    GitHub | 3 years ago | Blaisorblade
    java.util.zip.ZipException: invalid stored block lengths
  6. 0

    java.util.zip.ZipException: ZIP_Read: error reading zip file

    Stack Overflow | 2 years ago | zohar
    java.util.zip.ZipException: ZIP_Read: error reading zip file

  1. tyson925 1 times, last 7 months ago
3 unregistered visitors
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.util.zip.ZipException

    ZipFile closed

    at java.util.zip.ZipFile.ensureOpenOrZipException()
  2. Java RT
    BufferedReader.readLine
    1. java.util.zip.ZipFile.ensureOpenOrZipException(ZipFile.java:524)
    2. java.util.zip.ZipFile.access$1400(ZipFile.java:35)
    3. java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:556)
    4. java.util.zip.ZipFile$2.fill(ZipFile.java:338)
    5. java.util.zip.InflaterInputStream.read(InflaterInputStream.java:134)
    6. sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
    7. sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
    8. sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
    9. java.io.InputStreamReader.read(InputStreamReader.java:167)
    10. java.io.BufferedReader.fill(BufferedReader.java:136)
    11. java.io.BufferedReader.readLine(BufferedReader.java:299)
    12. java.io.BufferedReader.readLine(BufferedReader.java:362)
    12 frames
  3. com.essbase.eas
    CASCommandListener.callBack
    1. com.essbase.eas.essbase.server.CASLogic.getUserListPanel(Unknown Source)
    2. com.essbase.eas.essbase.server.CASLogic.getUserListPanel(Unknown Source)
    3. com.essbase.eas.essbase.server.CASCommandListener.getUserListPanel(Unknown Source)
    4. com.essbase.eas.essbase.server.CASCommandListener.callBack(Unknown Source)
    4 frames
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:585)
    4 frames
  5. com.essbase.eas
    AppManServlet.doPost
    1. com.essbase.eas.framework.server.application.AbstractCommandListener.handleEvent(Unknown Source)
    2. com.essbase.eas.framework.server.application.DefaultCommandDispatcher.dispatchEvent(Unknown Source)
    3. com.essbase.eas.framework.server.application.DefaultEventController.handleEvent(Unknown Source)
    4. com.essbase.eas.framework.server.application.EventDispatcherWorkListener.handleEvent(Unknown Source)
    5. com.essbase.eas.framework.server.application.DefaultWorkDispatcher.dispatchEvent(Unknown Source)
    6. com.essbase.eas.framework.server.application.DefaultEventController.handleEvent(Unknown Source)
    7. com.essbase.eas.framework.server.application.DefaultApplication.generateWorkEvent(Unknown Source)
    8. com.essbase.eas.framework.server.application.DefaultServlet.handleRequest(Unknown Source)
    9. com.essbase.eas.server.AppManServlet.doPost(Unknown Source)
    9 frames
  6. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    2. javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    2 frames
  7. com.evermind.server
    AJPRequestHandler.run
    1. com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
    2. com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
    3. com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
    4. com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
    5. com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302)
    6. com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190)
    6 frames
  8. oracle.oc4j.network
    ServerSocketReadHandler$SafeRunnable.run
    1. oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    1 frame
  9. com.evermind.util
    ReleasableResourcePooledExecutor$MyWorker.run
    1. com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    1 frame
  10. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:595)
    1 frame