Are you using FileInputStream or FileOutputSteam on the file and closing the stream before deletion? If so, change to Files.newInputSteam or Files.newOutputStream.

One of our application (not a web application) was running out of file handles even though we were closing the file handles. Everything was in try block and we did verify the handles were closed as far our code was concerned. It turned out that JVM does not close the actual handles until late in the game. There is a bug on openjdk bugs tracker that discusses this. After using Files, our issue was resolved.

If you are closing the file and JVM is not releasing the handles, this sounds very similar to the issue we faced.


Regards,


Niranjan


On 10/8/22 09:36, Martin Moore wrote:
Hello, I am facing a problem using Tomcat V8 with my J2ee app that deletes (using file. delete() Java 8) a file from disk (Windows). The file is actually deleting only on application level meaning that the application does not see the file anymore
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.
ZjQcmQRYFpfptBannerEnd
Hello,

I am facing a problem using Tomcat V8 with my J2ee app that deletes (using
file.delete() Java 8) a file from disk (Windows). The file is actually
deleting only on application level meaning that the application does not
see the file anymore but if i open the folder i still see the file which is
then locked by Java process. I only get the file to be removed physically
when i close the Tomcat instance.

Does this problem relate to permissions in catalina.policy ?
How to solve this?

Reply via email to