Error Reading Zip File Java
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the java read zip file line by line company Business Learn more about hiring developers or posting ads with us Stack Overflow java read zip file without unzipping Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 java read zip file from url million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to correct the error 'java.util.zip.ZipException: error in opening zip file' invoking web service on WAS with Portal up
Java Read Zip File Example
vote 0 down vote favorite I have developed a web service for Portal 7.0 and deployed the application into an environment. The installation and start up of the application is fine, however, when the web service is invoked, the following error appears in the SystemOut.log a few hundred times. The server then starts reporting other errors about 'Too many open files' until the application is stopped or the services restarted. [7/29/14 8:45:56:647 EST] java read zip file from inputstream 00000057 WSClassFinder E WSWS7058E: A JAXBContext could not be created correctly because of the following error: java.util.zip.ZipException: error in opening zip file [7/29/14 8:45:56:647 EST] 00000057 WSClassFinder E WSWS7058E: A JAXBContext could not be created correctly because of the following error: java.util.zip.ZipException: error in opening zip file Strange thing is we have a development and production environment that are basically identical (Same Linux OS version + WAS and Portal 7.0.0.23). Initially the web service worked fine in dev, but an attempt to use it in production failed (Not a good look). After rebooting dev, the problem started to occur there as well (at least it is now consistent). I also tried to build the most basic of basic web service applications (it just returns a single static string) and even that failed with exactly the same result when invoked. I have a separate development environment where I do most of my work which is separate to the one above, but with the same app versions. This one has always worked fine. This suggests it is a configuration or server issue. I have used tracing on the com.ibm.ws.classloader and java.util.zip without any very useful information. Class loader didn't seem to clearly indicate the root of the problem and java.util.zip didn't report anything in the trace. Unfortunately I'm stuc
here for a quick overview
Error In Opening Zip File Java
of the site Help Center Detailed answers to any questions you
Java.util.zip.zipexception Error In Opening Zip File Tomcat
might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow http://stackoverflow.com/questions/25053124/how-to-correct-the-error-java-util-zip-zipexception-error-in-opening-zip-file the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 http://stackoverflow.com/questions/27103870/java-util-zip-zipexception-zip-read-error-reading-zip-file million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up java.util.zip.ZipException: ZIP_Read: error reading zip file up vote 0 down vote favorite When running the following code: ZipFile zipFile = new ZipFile(new File("/fodler", "zipfile.zip")); ZipEntry zipEntry = zipFile.entries().nextElement(); LineNumberReader reader = new LineNumberReader(new InputStreamReader(zipFile.getInputStream(zipEntry), "8859_1"), 1024 * 1024); reader.readLine(); Sometimes I get the following exception: java.util.zip.ZipException: ZIP_Read: error reading zip file at java.util.zip.ZipFile.read(Native Method) at java.util.zip.ZipFile.access$1200(ZipFile.java:31) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:459) at java.util.zip.ZipFile$1.fill(ZipFile.java:242) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141) 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.LineNumberReader.readLine(LineNumberReader.java:182) When restarting the service it works as expected. Any idea? java zip share|improve thi
reading zip file Summary: https://netbeans.org/bugzilla/show_bug.cgi?id=205467 java.util.zip.ZipException: error reading zip file Status: RESOLVED WORKSFORME Product: platform Classification: Unclassified Component: Module System Version: 7.0 Hardware: All All Priority: P3 (vote) TargetMilestone: TBD https://samebug.io/exceptions/75390/java.util.zip.ZipException/zip_read-error-reading-zip-file Assigned To: Jaroslav Tulach QA Contact: issues@platform URL: Whiteboard: EXCEPTIONS_REPORT Keywords: Depends on: Blocks: Show dependency tree /graph Reported: 2011-11-23 11:21 UTC zip file by Exceptions Reporter Modified: 2011-12-05 10:40 UTC (History) CC List: 0 users See Also: Issue Type: DEFECT Exception Report : Attachments stacktrace (471 bytes, text/plain) 2011-11-23 11:22 UTC, Exceptions Reporter Details View All Add an attachment (proposed patch, testcase, etc.) Note You need to log in before java read zip you can comment on or make changes to this bug. Description Exceptions Reporter 2011-11-23 11:21:59 UTC This issue was reported manually by mmirilovic. It already has 22 duplicates Build: NetBeans IDE 7.0 (Build 201104080000) VM: Java HotSpot(TM) Client VM, 16.0-b06, Java(TM) SE Runtime Environment, 1.7.0-ea-b66 OS: Windows XP User Comments: GUEST: Testing a module on target platform. Problem reporting dialog will not accept my username/password, therefore I am sending as "Guest." DAFitzgibbons dafitz@inav.net GUEST: ??-?? ???????? ??????????? ?????? joyranga: Getting this error while starting Netbeans GUEST: i am opening the netbeans ide joyranga: Error while starting Netbeans GUEST: Netbeans wurde installiert... Stacktrace: java.util.zip.ZipException: error reading zip file at java.util.zip.ZipFile.read(ZipFile.java:0) at java.util.zip.ZipFile.access$1300(ZipFile.java:51) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:619) at org.netbeans.JarClassLoader$JarSource.resource(JarClassLoader.java:547) at org.netbeans.Archive.flushCaches(Archive.java:247) at org.netbeans.Stamps$Store.store(Stamps.java:580) Comment 1 Exceptions Reporter 2011-11-23 11:22:00 UTC Created attachment 113457 [details] stacktrace Comment 2 Jaroslav Tulach 2011-12-05 10:40:30 UTC Last report from build 110408 Fo
help others java.util.zip.ZipException: ZIP_Read: error reading zip file Stack Overflow | zohar | 2 years ago 0 mark 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 find similars Java RT 0 0 mark [VFS-394] java.io.EOFException: Unexpected end of ZLIB input stream - ASF JIRA apache.org | 4 months ago java.util.zip.ZipException: ZIP_Read: error reading zip file find similars Java RT Commons VFS Java RT 0 0 mark db:: 4.84::invalid CEN header ( bad signature ) d9 hivmr.com | 3 months ago java.util.zip.ZipException: error reading zip file find similars Java RT 0 Speed up your debug routine! Automated exception search integrated into your IDE Test Samebug Integration for IntelliJ IDEA 0 mark java.util.zip.ZipException Oracle Community | 8 years ago | 807588 java.util.zip.ZipException: error reading zip file find similars Java RT 0 0 mark 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 clo