Environment: Windows 2019 Standard with latest JDK 17 and Apache Tomcat 8.5.87.
When trying to upload a file to the application running off Tomcat (custom software), we are getting the following error since 8.5.85 (works fine on 8.5.84). ERROR [2023-04-13 15:20:20]: com.company.dataimporter.servlet.FileUpload::doPost::85 Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp java.lang.IllegalStateException: Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp at org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.delete(DiskFileItem.java:428) ~[tomcat-coyote.jar:8.5.87] This same procedure works perfectly fine in 8.5.84. It was something introduced with 8.5.85. It also works fine on a Linux hosted version (Centos) for 8.5.84 and above. So it appears to be Windows centric. When I watch the procedure in the Catalina\localhost\company folder on 8.5.84, I see the tmp file generated and then immediately deleted (it's a small upload). On 8.5.85 and above, it's locked and can't be deleted. Thus causing the error. Anyone have any thoughts? Thanks for any help. William