Score:0

Tomcat blocks file when deleted from Java

pt flag

I am using a J2EE app deployed on Tomcat8 to delete a file on Windows (Desktop location). From a code side, the file is deleted and the returned code is OK. But when i check the file in the folder after that, i see it is locked, and can neither be deleted or renamed. In addition i noticed that if i closed Tomcat instance, the file gets removed automatically shortly after (1second). in my catalina.policy file i have added the following permission:

grant{
 permission java.security.AllPermission;
};

How to deal with this properly? should i add some other permission in the catalina.policy file?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.