java.io.IOException

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.

  • FULL PRODUCT VERSION : java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.3.9600] EXTRA RELEVANT SYSTEM CONFIGURATION : This issue relates to the following bug fix that was added in JRE 8 u60: http://bugs.java.com/view_bug.do?bug_id=8062552 A DESCRIPTION OF THE PROBLEM : Following a call to KeyStore.load() with non-null InputStream and password, the input stream appears to be closed, when using JRE 8 u60 with a default value for security property "keystore.type.compat" (true). Using previous versions of JRE (e.g. u51) or with "keystore.type.compat" set to "false", the input stream remains open. I haven't seen anything in documentation for https://docs.oracle.com/javase/8/docs/api/java/security/KeyStore.html#load-java.io.InputStream-char:A- that talks about JRE closing the stream, I think that should be left to the caller to manage. REGRESSION. Last worked in version 8u51 ADDITIONAL REGRESSION INFORMATION: java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode) STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Create an instance of JKS keystore (ks1) 2. Persist it on file system or in memory 3. Create a new instance of JKS keystore (ks2) 4. Open the input stream pointing at persisted keystore from step 2 5. Load ks2, using the input stream from 4 6. Attempt to access the input stream after the loading has completed (by performing a call to either .reset, .available, etc) EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Expectation is that the stream can continue being used by the caller (e.g. in my application the stream was pointing to a JarInputStream, and the code was attempting to iterate through the Jar entries, processing some of them as keystores) ACTUAL - The actual result was IOException: Stream is closed being thrown when trying to use the stream that was passed to KeyStore.load. ERROR MESSAGES/STACK TRACES THAT OCCUR : java.io.IOException: Stream Closed at java.io.FileInputStream.available(Native Method) or java.io.IOException: Stream closed at java.util.zip.ZipInputStream.ensureOpen(Unknown Source) ~[na:1.8.0_60] at java.util.zip.ZipInputStream.getNextEntry(Unknown Source) ~[na:1.8.0_60] at java.util.jar.JarInputStream.getNextEntry(Unknown Source) ~[na:1.8.0_60] at java.util.jar.JarInputStream.getNextJarEntry(Unknown Source) ~[na:1.8.0_60] REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public class Foo { public static void main(String[] args) { try { KeyStore keystore1 = KeyStore.getInstance("JKS"); keystore1.load(null, null); File temp = File.createTempFile("temp-file-name", ".tmp"); FileOutputStream fos = new FileOutputStream(temp); keystore1.store(fos, "password".toCharArray()); fos.close(); FileInputStream fis = new FileInputStream(temp); KeyStore keystore2 = KeyStore.getInstance("JKS"); keystore2.load(fis, "password".toCharArray()); fis.available(); // this throws IOException: stream closed since jre8u60 fis.close(); } catch (Exception e) { System.out.println(e); } } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Temporary workaround seems to be invoking: Security.setProperty("keystore.type.compat", "false"); on application/applet initialization.
    via by Webbug Group,
  • FULL PRODUCT VERSION : java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.3.9600] EXTRA RELEVANT SYSTEM CONFIGURATION : This issue relates to the following bug fix that was added in JRE 8 u60: http://bugs.java.com/view_bug.do?bug_id=8062552 A DESCRIPTION OF THE PROBLEM : Following a call to KeyStore.load() with non-null InputStream and password, the input stream appears to be closed, when using JRE 8 u60 with a default value for security property "keystore.type.compat" (true). Using previous versions of JRE (e.g. u51) or with "keystore.type.compat" set to "false", the input stream remains open. I haven't seen anything in documentation for https://docs.oracle.com/javase/8/docs/api/java/security/KeyStore.html#load-java.io.InputStream-char:A- that talks about JRE closing the stream, I think that should be left to the caller to manage. REGRESSION. Last worked in version 8u51 ADDITIONAL REGRESSION INFORMATION: java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode) STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Create an instance of JKS keystore (ks1) 2. Persist it on file system or in memory 3. Create a new instance of JKS keystore (ks2) 4. Open the input stream pointing at persisted keystore from step 2 5. Load ks2, using the input stream from 4 6. Attempt to access the input stream after the loading has completed (by performing a call to either .reset, .available, etc) EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Expectation is that the stream can continue being used by the caller (e.g. in my application the stream was pointing to a JarInputStream, and the code was attempting to iterate through the Jar entries, processing some of them as keystores) ACTUAL - The actual result was IOException: Stream is closed being thrown when trying to use the stream that was passed to KeyStore.load. ERROR MESSAGES/STACK TRACES THAT OCCUR : java.io.IOException: Stream Closed at java.io.FileInputStream.available(Native Method) or java.io.IOException: Stream closed at java.util.zip.ZipInputStream.ensureOpen(Unknown Source) ~[na:1.8.0_60] at java.util.zip.ZipInputStream.getNextEntry(Unknown Source) ~[na:1.8.0_60] at java.util.jar.JarInputStream.getNextEntry(Unknown Source) ~[na:1.8.0_60] at java.util.jar.JarInputStream.getNextJarEntry(Unknown Source) ~[na:1.8.0_60] REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public class Foo { public static void main(String[] args) { try { KeyStore keystore1 = KeyStore.getInstance("JKS"); keystore1.load(null, null); File temp = File.createTempFile("temp-file-name", ".tmp"); FileOutputStream fos = new FileOutputStream(temp); keystore1.store(fos, "password".toCharArray()); fos.close(); FileInputStream fis = new FileInputStream(temp); KeyStore keystore2 = KeyStore.getInstance("JKS"); keystore2.load(fis, "password".toCharArray()); fis.available(); // this throws IOException: stream closed since jre8u60 fis.close(); } catch (Exception e) { System.out.println(e); } } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Temporary workaround seems to be invoking: Security.setProperty("keystore.type.compat", "false"); on application/applet initialization.
    via by Webbug Group,
  • Stream closed error using JWrapper
    via Stack Overflow by Frans
    ,
  • cannot start up sonatype nexus 2.0.2
    via Stack Overflow by tgf2
    ,
  • wrapper | --> Wrapper Started as Console wrapper | Launching a JVM... jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. jvm 1 | jvm 1 | 2013-11-15 10:36:49 INFO [er_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Starting with arguments: [./conf/jetty.xml] jvm 1 | 2013-11-15 10:36:49 INFO [er_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - JVM ID: 1, JVM PID: 19043, Wrapper PID: 19041, User: nexus jvm 1 | 2013-11-15 10:36:49 INFO [er_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Current directory: /usr/lib/nexus-oss/nexus-2.1.2 jvm 1 | 2013-11-15 10:36:49 INFO [er_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Temp directory: /usr/lib/nexus-oss/main-repo/tmp jvm 1 | 2013-11-15 10:36:49 INFO [y-main-thread-1] - org.eclipse.jetty.server.Server - jetty-8.1.3.v20120416 jvm 1 | 2013-11-15 10:36:49 INFO [y-main-thread-1] - org.sonatype.sisu.jetty.custom.DisableTagLibsListener - Disabling TLD support for WebAppContext on context path: /nexus jvm 1 | 2013-11-15 10:36:50 WARN [y-main-thread-1] - org.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext{/nexus,file:/usr/lib/nexus-oss/nexus-2.1.2/nexus/},/usr/lib/nexus-oss/nexus-2.1.2/nexus jvm 1 | java.io.IOException: Stream closed. jvm 1 | at java.util.zip.ZipInputStream.getNextEntry(libgcj.so.10) ~[na:na] jvm 1 | at java.util.jar.JarInputStream.getNextEntry(libgcj.so.10) ~[na:na] jvm 1 | at java.util.jar.JarInputStream.getNextJarEntry(libgcj.so.10) ~[na:na] jvm 1 | at org.eclipse.jetty.webapp.JarScanner.matched(JarScanner.java:152) ~[jetty-webapp-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.util.PatternMatcher.matchPatterns(PatternMatcher.java:82) ~[jetty-util-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.util.PatternMatcher.match(PatternMatcher.java:64) ~[jetty-util-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.webapp.JarScanner.scan(JarScanner.java:78) ~[jetty-webapp-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.webapp.MetaInfConfiguration.preConfigure(MetaInfConfiguration.java:78) ~[jetty-webapp-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:417) ~[jetty-webapp-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:453) ~[jetty-webapp-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) [jetty-util-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224) [jetty-server-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167) [jetty-server-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) [jetty-util-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90) [jetty-server-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.server.Server.doStart(Server.java:262) [jetty-server-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) [jetty-util-8.1.3.v20120416.jar:8.1.3.v20120416] jvm 1 | at org.sonatype.sisu.jetty.Jetty8$JettyWrapperThread.run(Jetty8.java:145) [sisu-jetty8-1.3.jar:na] jdk - Oracle 1.7.0_25
    via by Gospodin Bodurov,
    • java.io.IOException: Stream closed at java.util.zip.ZipInputStream.ensureOpen(Unknown Source)[na:1.8.0_60] at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)[na:1.8.0_60] at java.util.jar.JarInputStream.getNextEntry(Unknown Source)[na:1.8.0_60] at java.util.jar.JarInputStream.getNextJarEntry(Unknown Source)[na:1.8.0_60]

    Users with the same issue

    kid
    1 times, last one,