CAN NOT DELETE FILE ?!

This is odd:
I have listed certain files on a JSP page. When I click the filename you are prompted to a another page where you can modify information the file contains. If I try to delete the file, the file simply exists???
The file is a serialized object, but that should not cause the problem?
I am using TomCat 4.0.2
File f = new File( "filename.dat" );
if( f.exists() && f.canWrite() ){
if( f.delete() )
     System.out.println("File deleted.");                                   
The scope is session on the JSP page.
Any help would be great!!
-Eki

I am having the same problem too.
After reading so many article in the forum regarding to this issue and the solution other people posted. None of them is useful.
They are all wrong.
It is not because of the thread issue. It is not because of it is not exist or something else
It is because, no matter what webserver you are using, the jsp in default is prohibit you from delete any file in the server side.
After long time of testing, I find out the solution.
I am using the J2EE implementation server, but I believe other is similar.
1. search for the server.policy file
Mine is C:\j2sdkee1.3.1\lib\security\server.policy
I think other is webserver is similar
Inside this section
grant {
permission java.net.SocketPermission "*", "connect";
permission java.util.PropertyPermission "*", "read";
// workaround missing doPrivileged blocks in javamail
permission java.io.FilePermission "${com.sun.enterprise.home}${/}lib${/}j2ee.jar", "read";
permission javax.security.auth.PrivateCredentialPermission "javax.resource.spi.security.PasswordCredential * \"*\"", "read";
permission javax.security.auth.PrivateCredentialPermission "javax.resource.spi.security.GenericCredential * \"*\"", "read";
3. Insert this line in the between the grant block
permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
4. Restart your server, it should work now.

Similar Messages

  • Can not delete files from Adobe reader

    can not delete files from adobe reader.

    Can you let us know a little more about what you are trying to do? Adobe Reader opens pdf files but does not store them so, there's nothing to delete.

  • Hi, I can not delete files Film / video from the desktop it wants my password I write but Ando I can not float to Trash

    Hi, I can not delete files Film / video from the desktop it wants my password I write but Ando I can not float to Trash

    This topic has a fix for that problem: Desktop to Trash Problem: "Finder wants...: Apple Support Communities
    OT

  • I can not delete files to clean up existing files. I can from my phone but not my PC

    i can not delete files to clean up existing files. I can from my phone but not my PC

    Hi chrisb64054279,
    Are you referring to files stored in your Acrobat.com online account at https://cloud.acrobat.com/files? If so, what happens when you try to delete the files? Are you receiving an error message?
    Please provide a few more details about the issue that you're encountering, including what operating system you're on, and what browser you're using (if any). We'll get this sorted out.
    Best,
    Sara

  • Can not delete file with illegal character

    have a file with name of e}ail.txt
    can not delete it. Tried e*.txt, did not work.
    removed everything from the directory , renamed the directory to badDirectory , tried rm badDirectory /s /q
    and that didn't work.
    dir /X did not report an 8.3 file name.
    can not delete file or directory from FileManager either.
    went to a Linux box and did an smbfs mount. Still can not delete file.
    So, how does one delete a file with a openface curly bracket in the name?
    TechNet

    odder and odder:
    R:\rem>move badDirectory \junk\
    1 dir(s) moved.
    R:\rem>cd \junk
    R:\junk>rd \\.\r:\junk\badDirectory
    The directory is not empty.
    R:\junk>rd \\.\r:\junk\badDirectory /s /q
    \\.\r:\junk\badDirectory\e}ail.txt - The system cannot find the file specified.
    \\.\r:\junk\badDirectory\email.txt.bak - The system cannot find the file specified.
    R:\junk>dir badDirectory
    in drive R is f drive
    Serial Number is 58E7-B426
    Directory of R:\junk\badDirectory
    12/17/2014 02:41 PM <dir> .
    12/17/2014 02:41 PM <dir> ..
    08/30/2012 08:54 AM 68,719,477,275 e}ail.txt
    10/05/2011 11:11 AM 488 email.txt.bak
    2 File(s) 68,719,477,763 bytes
    2 Dir(s) 2,236,207,104 bytes free
    </dir></dir>
    The file e}mail.txt is not nearly that large, more like the size of the bak file. And when I try to use character completion type e} I get type e}badDirectory
    TechNet

  • All of a sudden can not delete files unless I enter password each time, why?

    as title indicates why has my system changed? any ideas why I can not delete without a password?

    I understand that I do not have permission, my inquiry is why, I have had lion installes for about 3 weeks and a few hours ago for no reason I am unable to delete without a password. My system was not updated changed or manipulated by me in any way for the past week unless it was done behind the scenes with no visual or auditory notification!

  • I can not delet files as Start up disk is full and I can not open up

    My macbook air  do not start up as I can not delite files and  make more rooms for start updisk

    Boot to the Recovery HD:
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the arrow button below the icon.
    Connect an external completely erased USB drive to one of the USB ports. Select Disk Utility from the Utility menu and click on the Continue button. Clone your startup volume to the external drive:
    Clone using Restore Option of Disk Utility
      1. Select the destination volume from the left side list.
      2. Click on the Restore tab in the DU main window.
      3. Select the destination volume from the left side list and drag
           it to the Destination entry field.
      4. Select the source volume from the left side list and drag it to
          the Source entry field.
      5. Double-check you got it right, then click on the Restore button.
    Destination means the external backup drive. Source means the internal startup volume.
    When the above is completed you need to erase the internal drive and reinstall OS X.
    Install or Reinstall Mavericks or Mountain Lion from Scratch
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    OS X Mavericks- Erase and reinstall OS X
    OS X Mountain Lion- Erase and reinstall OS X
    OS X Lion- Erase and reinstall Mac OS X
    Note: You will need an active Internet connection. I suggest using Ethernet if possible
                because it is three times faster than wireless.

  • Can not delete file. Error is "Could not find this item".

    I get the following error when trying to delete a file:  "Item not found".  This is a Word 2007 document that would not save properly so I saved it with a different name.  Now I can't delete the original file.
    The body of the error states "Could not find this item.  This is no longer located in... . Verify the item's location and try again.

    Hi,
    I'm having exact the same problem with a file with a long name, to delete, move, rename, attribute change, etc. I deleted the file, which I receive the confirmation. However, the file is still there, with zero bytes and no extension. When I try
    to delet, move or change the file, I get the error "Could not find this item, This is no longer located in xxx. Verify the item's location and try again."
    I tryed everything: Using DOS, there's no 8.3 name format; In safe mode; chkdsk and sfc. Nothing worked.
    I also tryed the tricks in http://www.sevenforums.com/general-discussion/27924-could-not-find-item-when-deleting-files-3.html
    http://forums.techarena.in/vista-help/1038943.htm
    Without success.
    I took some more time and found this tool on the net "DelinvFile". It works perfectly, after trying EVERYTHING!!!.
    I Have Windows 7 professional 64bits and NTFS.
    Thank you very much.
    Thankyou Thankyou Thankyou Thankyou......... We are almost bald tearing our hair out over this issue and how to fix it.     Delin File WORKS...... At the cost of about 28 bucks well worth it.............. Good onya mate............

  • Windows 2012 R2 - ReFS - Can not delete file with invaild name

    I have a file, its name is ÿÿÿÿ.out
    its in a network share.  its causing the backups to fail on it because its invalid.
    in the past on NTFS i would just run chkdsk and then it would fix something like this.  but can't do that on this.
    Chkdsk just says "Refs doesn't need to be checked"
    tried from the GUI also, same thing "volume doesn't need checking"
    also i tried the magical "maintenance" on server 2012 properties.   nothing
    i've tried all sorts of command prompt tricks...  Also i've created file names in the same folder like "asdfalksdjfhsalkfsafddsaf.txt" and deleted them (just in cause the name length might be the issue because its in a long folder tree)
    Its a file name, called ÿÿÿÿ.out   
    Any ideas ?

    Hi,
    I just discussed this issue in this thread:
    http://social.technet.microsoft.com/Forums/en-US/4a90066d-aa2d-4f57-976e-ec1b65a4bcec/weird-behavior-with-refs?forum=winserverfiles
    It seems that ÿ is not supported as a file name in Refs file system.
    If you have any feedback on our support, please send to [email protected]

  • I can not delete or copy new files to my Iomega external hard drive

    Hi,
    I can not delete or copy new files to my Iomega external hard drive. Opening hard drive folder I can see that I can not overwrite it. I have heard that I need to install some program for the external hard drive to operate properly in Mac.
    Please help what to install or there is some other option.
    Thnx

    I'm not the expert on this since I have never done it. It sounds like you may need a data rescue program like Data Rescue III. I believe you can download a demo and see if you can see the files. If you can, then you can buy the program and retrieve the files. I don't know if Disk Utility can restore them--I think they have to be visible but this is not something I have ever had to do.
    In the meantime, don't do anything with the drive--you don't want to overwrite any files. Hopefully all or most of the files are still there and you will be able to retrieve them. The less the drive is used, the better your chances are of retrieving the data.
    Forgive me for not realizing that there were files on the drive that you wanted to save. Upon re-reading your question, I now see that there were. I should have known to warn you, and my bad that I didn't.
    Good luck!

  • I was copying files to my time capsule when it crashed when it was almost finished. Now I am stuck with a light grey folder I can not delete. I would´t care if it wasn´t for the fact the folder is 1 TB size and takes up too much space. I ha

    I was copying files to my time capsule when it crashed when it was almost finished. Now I am stuck with a light grey folder I can not delete. I would´t care if it wasn´t for the fact the folder is 1 TB size and takes up too much space. I have tried turning on and of Hiding Files in Finder and what not with no success. So, how do I delete this folder. Remember, I am not extremely familiar with technical terms.

    I recommend you erase the TC.. it is the easiest and fastest solution.
    In Airport utility open the disk tab and select erase.. choose quick erase.. it will take less than 1min.
    Start again but copy files in small amounts.

  • Can't delete files in iTunes 10.4 (80) OS 10.7 Delete in the edit menu is not hi-lighted?

    Can't delete files in iTunes 10.4 (80) OS 10.7 Delete in the edit menu is not hi-lighted. Any sugestions? I have three Mac's and they all have the same problem.

    Gmatos, when I high-light and drag file from iTunes to my trash the usual promt of "do I want to remove it" followed by by the uual "do I want to keep the file or remove that from my library" comes up too. I click "dont keep file" and it is gone from my itunes and my library an my HD. It's exactly the same as it's always been except annoyingly this is the only way I can do it as the delete button just doesn't work in this latest version.
    Hope this is clearer for you.

  • I want to install the latest version of i tunes. I recieve an error that the MSI file is missing. It won't load the new version and I can not delete the software either. HELP!

    I have a windows computer running xp. I can not load the latest version of I tunes. I receive an error message that the 'msi" file can not be found. I can not delete I tunes for the same reason.
    HELP

    ItIt is the the ituens msi file
    From: Apple Support Communities Updates
    [email protected]
    Sent: Monday, February 27, 2012 3:40 PM
    To: escow 39
    Subject: - Re: I want to install the latest version of
    i tunes. I recieve an error that the MSI file is missing. It won't load the
    new version and I can not delete the software either. HELP!
      <http://images.apple.com/support/images/emails/apple_logo_gray.gif>
    <https://discussions.apple.com/index.jspa> Apple Support Communities
    Re: I want to install the latest version of i tunes. I recieve an error that
    the MSI file is missing. It won't load the new version and I can not delete
    the software either. HELP!
    created by b noir <https://discussions.apple.com/people/b+noir>  in iTunes
    for Windows - View the full discussion
    <https://discussions.apple.com/message/17708214?ac_cid=142432#17708214

  • Can not delete a movie file

    Hi there
    a couple of days ago i downloaded a movie file with .avi extension on the desktop of my mac from windows formatted ipod. and now i can not delete it, there is a small lock sign in the bottom and when i try to delete it says: the operation can not be completed because file is locked. Please help.
    thanks

    Select the file, choose Get Info from the File menu, and uncheck the Locked checkbox. You should now be able to delete the file.
    (17199)

  • I can not delete some power point files in the trash.help?

    I can not delete some power point files in the trash.help?

    Hi Gary,
    The presentations were created originally with PowerPoint. I have been using them on both KeyNote and PowerPoint with no problem, even after updating to MountainLion. Problems started at the 10.8.3 upgrade. The installation was an upgrade form Lion. Yes I mean Open Office, I am able to open the presentation with Open Office and play it with no problems.
    The presentation gets loaded by Power Point and the Power Point freezes. Key Note can not even load it. Stops 3/4 of the way. This happens with ALL my presentations.
    I want to thank you for your help.
    Leonardo

Maybe you are looking for

  • Is mozilla firefox compatible with windows 8.1? If so, what version?

    is mozilla firefox compatible with windows 8.1? If so, what version?

  • Need details about Supported Device jsr184

    Dear friends i want details abt jsr 184. Following things i know it is used for developing 3d graphics mobile game it is only run over the WTK2.2 which has one package .m3g I want following details which mobile devices(nokia or motrolo or ...) would

  • Working with JProgressBar

    I know how to put JProgressBar when we are reading a The code may be like progressBar = new JProgressBar(0, task.getLengthOfTask());//length of task  for reading a file is its size   progressBar.setValue(0);    progressBar.setString("Validation in  

  • How to undo software update in Nokia x6 and recove...

    A friend had a software update done on my Nokia x6 - 8GBand now it is as good as new. All the data, files, photos and videos in it are gone. I had not backed them up as the software update wasn't intentional. It is really heartbreaking to lose all th

  • Adding values to insert query [was: Plz help with this code]

    I have created a comments section in which there is only one field comment here is the code of the form: <form id="frmComment" name="frmComment" method="POST" action="<?php echo $editFormAction; ?>">     <h3>       <label for="namegd"></label>Comment