Le 11/10/2012 14:38, Timo Boehme a écrit :
Hi,
first, please do not cut relevant parts from the conversation like the
original error since it is hard to follow otherwise.
You'r right. I've removed old overquoted text in order to preserve
readability.
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.
No, there is no close() in the process. But the process is runing inside
a threaded environnement; the File.createTempFile seems thread safe, but
I do not trust the Weblogic jvm…
The problem is : how to check if :
* the file is deleted by the java process
* the file is deleted by the environemnt (cron job, another application)
* the file has never existed
Thanks,
--
Sébastien Dailly