Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Isn't that an empty while loop?</p> <p>you have:</p> <pre><code>try { ...code } finally { } while (something); </code></pre> <p>put some whitespace in there, and you actually have:</p> <pre><code>try { ...code } finally { } while (something) ; </code></pre> <p>your while loop isn't related to your try/finally. if your original try statement fails and the file isn't created, that while loop will never complete, because the try/finally will never execute a second time.</p> <p>did you intend to make that a do{ all your code } while (your while statement)? because that isn't what you have there.</p> <p>EDIT to clarify: my suggestion would be to change your while loop to have more info of why it can't delete:</p> <pre><code>while (!file.delete()) { if (!file.exists()) break; // the file doesn't even exist, of course delete will fail if (!file.canRead()) break; // the file isn't readable, delete will fail if (!file.canWrite()) break; // the file isn't writable, delete will fail } </code></pre> <p>because if delete fails once, its just going to fail over and over and over, of course its going to hang there. you aren't changing the state of the file in the loop.</p> <p>Now that you've added other info, like Tomcat, etc, is this a permissions issue? are you trying to write to a file that the user tomcat is running as (nobody?) vm can't create? or delete a file that the tomcat process can't delete?</p> <p>If process explorer/etc say java has a lock on the file, then something still has an open stream using it. someone might have not properly called close() on whatever streams are writing to the file?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload