java.lang.IllegalStateException: Cannot read while there is an open stream writer

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by RDR
, 1 year ago
via Stack Overflow by Hari R
, 7 months ago
Cannot read while there is an open stream writer
java.lang.IllegalStateException: Cannot read while there is an open stream writer
at org.apache.pdfbox.cos.COSStream.createRawInputStream(
at org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(
at org.apache.pdfbox.cos.COSStream.accept(
at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObject(
at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObjects(
at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBody(
at org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(
at org.apache.pdfbox.cos.COSDocument.accept(
at org.apache.pdfbox.pdfwriter.COSWriter.write(
at org.apache.pdfbox.pdfwriter.COSWriter.write(
at com.helper.ScreenshotPDF.screenshotPDF(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(
at org.testng.internal.Invoker.invokeMethod(
at org.testng.internal.Invoker.invokeTestMethod(
at org.testng.internal.Invoker.invokeTestMethods(
at org.testng.internal.TestMethodWorker.invokeTestMethods(
at org.testng.TestRunner.privateRun(
at org.testng.SuiteRunner.runTest(
at org.testng.SuiteRunner.runSequentially(
at org.testng.SuiteRunner.privateRun(
at org.testng.SuiteRunnerWorker.runSuite(
at org.testng.TestNG.runSuitesSequentially(
at org.testng.TestNG.runSuitesLocally(
at org.testng.remote.RemoteTestNG.initAndRun(
at org.testng.remote.RemoteTestNG.main(

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.

Know the solutions? Share your knowledge to help other developers to debug faster.