org.nuxeo.ecm.core.api.ClientException: Failed to save document DocumentModelImpl(649ce38e-92f6-4d7f-9c49-432fb874b97b, path=/asset-library/Test Thumb, title=Test Thumb)

nuxeo.com | 3 months ago
  1. 0

    Can't generate picture thumbnails | Nuxeo Answers | Quandora

    nuxeo.com | 3 months ago
    org.nuxeo.ecm.core.api.ClientException: Failed to save document DocumentModelImpl(649ce38e-92f6-4d7f-9c49-432fb874b97b, path=/asset-library/Test Thumb, title=Test Thumb)
  2. 0

    InputStream object closes after declaration

    Stack Overflow | 3 years ago | phongdt
    java.io.IOException: Stream Closed
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    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.

    JDK Bug System | 1 year ago | Webbug Group
    java.io.IOException: Stream Closed
  5. 0

    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.

    JDK Bug System | 1 year ago | Webbug Group
    java.io.IOException: Stream Closed

    1 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.io.IOException

      Stream Closed

      at java.io.FileInputStream.available()
    2. Java RT
      FileInputStream.available
      1. java.io.FileInputStream.available(Native Method)
      1 frame
    3. org.nuxeo.ecm
      AbstractSession.saveDocument
      1. org.nuxeo.ecm.core.storage.sql.AbstractBinaryManager.storeAndDigest(AbstractBinaryManager.java:97)
      2. org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.storeAndDigest(LocalBinaryManager.java:176)
      3. org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.getBinary(LocalBinaryManager.java:114)
      4. org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:313)
      5. org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.getBinary(ConnectionImpl.java:161)
      6. org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1152)
      7. org.nuxeo.ecm.core.storage.sql.coremodel.SQLContentProperty.setValue(SQLContentProperty.java:80)
      8. org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setValue(SQLComplexProperty.java:101)
      9. org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setList(SQLComplexListProperty.java:278)
      10. org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setValue(SQLComplexListProperty.java:86)
      11. org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setPropertyValue(SQLComplexProperty.java:222)
      12. org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.writeDocumentPart(SQLDocumentLive.java:178)
      13. org.nuxeo.ecm.core.api.DocumentModelFactory.writeDocumentModel(DocumentModelFactory.java:298)
      14. org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:541)
      15. org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1961)
      15 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:601)
      4 frames
    5. org.nuxeo.ecm
      TransactionalCoreSessionWrapper.invoke
      1. org.nuxeo.ecm.core.api.TransactionalCoreSessionWrapper.invoke(TransactionalCoreSessionWrapper.java:133)
      1 frame
    6. com.sun.proxy
      $Proxy44.saveDocument
      1. com.sun.proxy.$Proxy44.saveDocument(Unknown Source)
      1 frame
    7. org.nuxeo.ecm
      AbstractWork.run
      1. org.nuxeo.ecm.platform.picture.PictureViewsGenerationWork.work(PictureViewsGenerationWork.java:45)
      2. org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:164)
      2 frames
    8. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      3. java.lang.Thread.run(Thread.java:722)
      3 frames