java.io.IOException

COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed?

Solutions on the web12187

  • COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed?
  • via Stack Overflow by David Lasry
    , 5 months ago
    COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed?
  • via Stack Overflow by Denelio
    , 12 hours ago
    COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed?
  • Stack trace

    • java.io.IOException: COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed? at org.apache.pdfbox.cos.COSStream.checkClosed(COSStream.java:77) at org.apache.pdfbox.cos.COSStream.createOutputStream(COSStream.java:198) at org.apache.pdfbox.cos.COSStream.createOutputStream(COSStream.java:186) at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.writeToStream(AppearanceGeneratorHelper.java:641) at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:303) at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:170) at org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:263) at org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.applyChange(PDTerminalField.java:228) at org.apache.pdfbox.pdmodel.interactive.form.PDTextField.setValue(PDTextField.java:218) at app.components.FieldPopulator.insertData(FieldPopulator.java:153) at app.components.FieldPopulator.populateGoodsFields(FieldPopulator.java:69) at app.Main.populateData(Main.java:55) at app.Main.main(Main.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:143)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.