Hi,
first, please do not cut relevant parts from the conversation like the
original error since it is hard to follow otherwise.
Your original statement:
We are encountering some errors with pdfbox on a AIX platform. We don't know
how to reproduce the problem, neither how to explain it…
The stacktrace here :
java.io.IOException: No such file or directory
at org.apache.pdfbox.io.RandomAccessFile.length(RandomAccessFile.java:83)
at
org.apache.pdfbox.io.RandomAccessFileOutputStream.<init>(RandomAccessFileOutputStream.java:52)
at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:300)
The RandomAccessFile is created by the constructor
COSDocument(File scratchDir, boolean forceParsingValue) which is called
by PDFParser.parse() if you've set a temporary directory via
PDFParser.setTempDirectory( File tmpDir ).
It will create a temporary file in the temp dir and provides this file
to RandomAccessFile.
If something went wrong until this point you would have got an exception
already. Thus the file existed but your exception shows it is missing at
a certain point. The only case the temporary file is deleted is when
calling COSDocument.close().
So I assume you have such close() call within your program before file
processing is finished.
Timo
Am 11.10.2012 14:03, schrieb Sébastien Dailly:
I think it is not the cause of the error : the exception is caused in
the processStream, so we have already loaded the document catalog,
readed the pages…
If the BufferedInputStream would be wrong or null, the Exception would
have been raised before.
I could'nt reproduced the problem : if the file does not exists, we have
another exception, and do not go throught the pdfbox parsing system…
It is as if Pdfbox can open the file and make its own temp files, but
fail when trying to read them… Maybe an environnment problem ? The same
code is working fine on other system.
By tracking the hierarchy call, its look like the COSStream object
created by :
page.getContents().getStream()
create a COSStream where the « file » property point on a non existent
file, but I don't know exactly where is created the RandomAccess object
during the Pdf parsing.
Nobody else but me has encountered this problem before ?
Thanks !
--
Timo Boehme
OntoChem GmbH
H.-Damerow-Str. 4
06120 Halle/Saale
T: +49 345 4780474
F: +49 345 4780471
[email protected]
_____________________________________________________________________
OntoChem GmbH
Geschäftsführer: Dr. Lutz Weber
Sitz: Halle / Saale
Registergericht: Stendal
Registernummer: HRB 215461
_____________________________________________________________________