Hi,

this means that ScratchFileBuffer(s) were created on ScratchFile without closing them. While a COSDocument will currently automatically close the ScratchFile, the buffers, using the ScratchFile still exists (there would be an IOException if a read/write method of the buffer is executed). There are 2 options coming to my mind for suppressing the debug error message in case ScratchFile is already closed ( a) check ScratchFile state before printing message, b) ScratchFileBuffer is listening to close call of ScratchFile and close itself), but I would rather propose to fix the source of the problem - the not closed buffer - which I believe will be an COSStream which is not closed.

In order to do the latter one we would need to have a short code snipped demonstrating the problem.


Best,
Timo


Am 11.12.2015 um 21:02 schrieb John Hewson:
Timo, any thoughts on this?

— John

Begin forwarded message:

From: Adam Retter <adam.ret...@googlemail.com>
Date: 1 December 2015 at 16:16:31 GMT-8
To: us...@pdfbox.apache.org
Subject: 2.0.0-RC2 ScratchFileBuffer not closed!

Hey guys,

Using either 2.0.0-RC1 or 2.0.0-RC2 I am seeing a lot of debug
messages which look like:

"ScratchFileBuffer not closed!"

When I trace this it appears that this is called by `finalize` being
called on the ScratchFileBuffer.

I am opening and closing my PDDocument by using try-with-resources, i.e.

try(final PDDocument doc = PDDocument.load(pdf.asFile)) {
...
}

As far as I can see I am not manually specifying any Scratch files,
are there any known issues with these not being correctly freed in
2.0.0?

Cheers Adam.

--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org





--
Timo Boehme
OntoChem IT Solutions GmbH
Blücherstraße 24
06120 Halle (Saale)
Germany

phone: +49 345 478 047 4      | fax: +49 345 478 047 1
email: ulf.la...@ontochem.com | web: www.ontochem.com
HRB 21962 Amtsgericht Stendal | USt-IdNr.: DE815563824
managing director : Lutz Weber


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to