java.util.zip.ZipException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Deploying Ear file UI vs command Line
    via by 636717,
  • 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.
    via by tomliliu,
  • 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.
    via by tomliliu,
    • java.util.zip.ZipException: ZipFile closed at java.util.zip.ZipFile.ensureOpenOrZipException(ZipFile.java:524) at java.util.zip.ZipFile.access$1400(ZipFile.java:35) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:556) at java.util.zip.ZipFile$2.fill(ZipFile.java:338) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:134) at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411) at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183) 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) at com.essbase.eas.essbase.server.CASLogic.getUserListPanel(Unknown Source) at com.essbase.eas.essbase.server.CASLogic.getUserListPanel(Unknown Source) at com.essbase.eas.essbase.server.CASCommandListener.getUserListPanel(Unknown Source) at com.essbase.eas.essbase.server.CASCommandListener.callBack(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.essbase.eas.framework.server.application.AbstractCommandListener.handleEvent(Unknown Source) at com.essbase.eas.framework.server.application.DefaultCommandDispatcher.dispatchEvent(Unknown Source) at com.essbase.eas.framework.server.application.DefaultEventController.handleEvent(Unknown Source) at com.essbase.eas.framework.server.application.EventDispatcherWorkListener.handleEvent(Unknown Source) at com.essbase.eas.framework.server.application.DefaultWorkDispatcher.dispatchEvent(Unknown Source) at com.essbase.eas.framework.server.application.DefaultEventController.handleEvent(Unknown Source) at com.essbase.eas.framework.server.application.DefaultApplication.generateWorkEvent(Unknown Source) at com.essbase.eas.framework.server.application.DefaultServlet.handleRequest(Unknown Source) at com.essbase.eas.server.AppManServlet.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)

    Users with the same issue

    Unknown visitor1 times, last one,
    tyson925
    1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,