Cannot delete file after calling JAI.create() method

hi all
this is the first time i write to this list
today i began to use the JAI api on a project
it works fine but i am not able to delete a file after using it
my code:
for(int i=2; i<2+filenames.size(); i++)           
                try
                    String fName=filenames.get(i-2).toString();                   
                    if(fName!=null)
                        File file=new File(uploadDir+"\\"+fName);
                        FileInputStream f=new FileInputStream(file);
                        ps.setBinaryStream(i, f,(int)file.length());
                        PlanarImage pi = JAI.create("fileload", uploadDir+"\\"+fName);
                        System.out.println ("heigh : "+pi.getHeight());
                        System.out.println ("width : "+pi.getWidth());
                        f.close();
                catch(NullPointerException n)
                    n.printStackTrace();
                    return;
for(int i=0; i<filenames.size(); i++)
                String fName=filenames.get(i).toString();  
                File file=new File(uploadDir+"\\"+fName);
                if(file.delete())
                    System.out.println(fName+" deleted");
                else
                    System.out.println(fName+" not deleted");                   
                           }i use this code in a servlet that receives an image to put it in a database.
JAI is useful to get heigth and width of it.
the problem is that i always get the "not deleted" message.
i'm quite sure that is a problem of the bold code (JAI code), also because, cutting it, i can delete my file
anyone could help me?
thanx a lot in advance
alessandro

excuse me another time!
my first post was right.
i'm not able to delete an image after creating it with JAI.create();
i'm still lookin' for a way to close all the references to my image in order to delete it
how?
thanx a lot
sandro

Similar Messages

  • Cannot delete files after emailing them

    Ever since I upgraded to Snow Leopard I cannot empty the trash if there is a file that I have added as an attachment in an email if Mail is still open. It will say the file is in use and I either have to quit Mail or Secure Empty Trash. This is really annoying. Anyone know of a fix? The file shouldn't be in use once it is sent in Mail. This never happened in previous versions of OSX. Also, if I have sent a file as an attachment I cannot save over it in the originating program because it is in use.

    No, this is only for Mail. As soon as I add a file as an attachment then I cannot delete it without quitting mail or secure empty the trash. It isn't a data loss deterrent because you get that message making sure you want to delete it but when I say yes then it says the file is in use.
    By the way, I shut off Time Machine for a day and then tried to delete a new file that I created after Time Machine was shut off that I added as an attachment to Mail and the same problem occurs. All other files that I do not add as an attachment in Mail I can delete with no problems.

  • HT1151 Cannot retrieve file after I forgot to properly eject the USB it was on--what can I do to get this file to open?

    Cannot retrieve file after I forgot to properly eject the USB it was on--what can I do to get this file to open?  Thanks for helping me out b/c it would take days to re-create this file!  IMAC 10.5.8 Excel File using .xls extension.

    Hi Sue,
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at the top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then Try a Repair on the External USB Drive.
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)

  • Failed to delete file after processing FTP

    Failed to delete file after processing. The FTP server returned the following error message: 'com.sap.ai i.adapter.file.ftp.FTPEx: 550 Unexpected reply code *.txt: The process cannot access the file because it is being used by another process. '. For details, contact your FTP server vendor.
    I got this error many times for the same interface. Not sure what is the reason for this.
    Searched on internet go comments that this is because of FTP version!
    Please help

    It is the "Msecs to Wait Before Modification Check" in the Sender Adapter that ensures this. It works like this: PI starts processing, finds a file, then waits the number of miliseconds specified and checks the file again to see if it has changed over the waiting period. If so, then it waits again to make sure the file is written completely. Only if no changes took place over the waiting period, it starts processing the file.
    And the fact that your file was successfully processed at retry only confirms that it might have been still written to by the sender system. You can try comparing file's creation timestamp (in OS level) with its processing start time in PI - this could prove me right.
    Edited by: Grzegorz Glowacki on Jan 13, 2012 2:15 PM

  • Cannot delete file Windows2Local/Components/{multiple}.settings

    Every time I shutdown JSE it shows a couple of ugly messages saying:
    "Cannot delete file Windows2Local/Components/classes.settings in C:\Documents and Settings\Joost\.jstudio\Ent8\config"
    "Cannot delete file Windows2Local/Components/sources.settings in C:\Documents and Settings\Joost\.jstudio\Ent8\config"
    "Cannot delete file Windows2Local/Components/watches.settings in C:\Documents and Settings\Joost\.jstudio\Ent8\config"
    "Cannot delete file Windows2Local/Components/properties.settings in C:\Documents and Settings\Joost\.jstudio\Ent8\config"
    "Cannot delete file Windows2Local/Components/designpattern.settings in C:\Documents and Settings\Joost\.jstudio\Ent8\config"
    "Cannot delete file Windows2Local/Components/threads.settings in C:\Documents and Settings\Joost\.jstudio\Ent8\config"
    Assuming that JSE had some problems to access my profile (oh, how I *hate* Windows...) I wanted to change the JSE working directory to C:\Projects\Java Studio Enterprise, but I can't find the place within the Tools|Options where I can set that. Help!
    Regards,
    Joost

    Thanks for the reply. I added the -userdir option, and now it complains:
    "Cannot delete file Windows2Local/Components/ComponentPalette.settings" in C:\Projects\Java Studio Enterprise\config"
    "Cannot delete file Windows2Local/Components/CollaborationExplorer.settings" in C:\Projects\Java Studio Enterprise\config"
    Hmmm, it seems to me that - although the number of error messages has been reduced - JSE is still not very happy about something. It would be nice if it was a bit more precise in its problem description.
    Regards,
    Joost

  • Cannot delete files from my ipod shuffle!!!

    I am new to using an ipod and i cannot delete files from my ipod, on itunes, it only shows the license agreement where the ipod files are supposed to be and no matter how many times i uninstall and reinstall itunes and agree to the license agreement i can't access anything else. can anyone help me at all i feel like a complete idiot!

    Pressing return will get past this screen as there is a button at the bottom right of iTunes which you likely cannot see.
    Set your screen resolution to at least 1024x768 to see this button.

  • ERROR MESSAGE AMT : CANNOT DELETE TOKEN AFTER IT WAS ASSIGNED TO A ROLE

    We are working on the setup in our sandbox environment and we have noticed that we are unable to delete tokens and remove the protection on BO's.
    the following message appears : "CANNOT DELETE TOKEN AFTER IT WAS ASSIGNED TO A ROLE"
    There is no Token assigned to any role anymore and we have also removed all rules and so on, Still it remains impossioble to remove the token on a protected BO or to remove the protection of a BO.
    Thanks for your help

    Hi Wim,
    Ive replied to your support message, requesting a remote connection so I can
    investigate further.
    Regards,
    Gervase

  • How can I call the create method in BO from Application Service

    Hello!
    When I create a Business Object, CAF generates some methods automatically.
    How can I call the create method in the BO from Application Service logic?
    When i call the method then the entityManager and the sessionContext is NULL.
    How can I initialize this?
    Can anybody help me?
    Thanks, Thomas

    If you are using CE 7.11...
    1) In the Application Services, add the BO as dependant object in dependencies tab.
    2) In the implemention, add the following codes to call create method of the BO:
    this.get<BO>.createMethod();
    julius

  • Admin suddenly cannot delete files without entering password?

    Admin (and sole user) suddenly cannot delete files without entering password?

    Admin (and sole user) suddenly cannot delete files without entering password?

  • Cannot delete file from disk after emailling that file like attachment

    After i send some file from disk in Mail like attachment i cannot delete that file from disk unless i quit Mail. Like Mail is still using a file. Of course, that mail is in Sent mail, not in outbox.

    This deeper than that. I created another account on the same iMac and it works in Harmony with my other devices and Documents in the cloud. I can only imagine the icloud account is somehow corrupted (I am on my macbook not iMac at the moment). There have been no updates to the Calendar, Contacts or Documents since early January on that account. I have spent 1hr on the phone with support and they were baffled as well. Only thing I can gove as insight to the problem is this, I was on the Mac Mini which was backed up on Time Machine. about 4 or 5 months ago I had to completley restore the Mac Mini becasue of the never ending circle on the load screen. The Backup failed to work it kept loading the issue and 4 or 5 times the circle of death kept coming up I would subsequently wipe the Mini and go further back in the back up until I go a copy that worked.  I then loaded the Time Mache back up into my NEW iMac and wnet from there. It took about a month for this problem I am detailing above to start happening. It maybe a corrupt file loaded from the backup into the new iMac causing this problem. Best answer I can think of on my own???

  • After Update, cannot delete files from nss volumes

    Not sure if this is the same problem caused by the SLES11 upgrade, but after running all the upgrades on an OES11 system, I can see all the nss volumes of the upgraded servers from workstations using the Novell client, and I can copy or create files on these volumes. However, I cannot delete any files, they disappear from the workstation windows explorer when they are "deleted", but an f5 promptly shows the files are still there. I can go into the server as root, and delete the files under Linux with no problems, so this part is working OK.
    I am running Novell 11.1 patch 1, and this problem has only been noticeable after the update installation.
    I have supervisor rights to the volumes and files, and if I additionally set all the other file rights, I am still unable to delete the files.
    Anyone got any ideas?
    Cheers.
    ChasR

    Originally Posted by chas
    Not sure if this is the same problem caused by the SLES11 upgrade, but after running all the upgrades on an OES11 system, I can see all the nss volumes of the upgraded servers from workstations using the Novell client, and I can copy or create files on these volumes. However, I cannot delete any files, they disappear from the workstation windows explorer when they are "deleted", but an f5 promptly shows the files are still there. I can go into the server as root, and delete the files under Linux with no problems, so this part is working OK.
    I am running Novell 11.1 patch 1, and this problem has only been noticeable after the update installation.
    I have supervisor rights to the volumes and files, and if I additionally set all the other file rights, I am still unable to delete the files.
    Anyone got any ideas?
    Cheers.
    ChasR
    I had a similar problem at updating with SP3 on SP4. It was similar, that permission ERASE is not applied to all trustees working through ncp in spite of the fact that it was available.
    Has solved a problem that has redefined this permission for trustees on all catalogues.

  • Cannot delete file on win7 after upgrading to Lion

    After upgrading Lion OS X, I can not delete file on Lion partition from win 7. It always says "This file is too large...".
    Also, My 2 HFS partition will not show on win 7. How to solve it?
    I did upgrade BootCamp to 3.3

    What your going to need to do is c boot and install OS X (10.6) from the disk, onto a blank external drive (format the drive first in Disk Utility: GUID OS X Extended (J))
    Once 10.6 is installed, hold the option key and boot from the 10.6 external drive, go through setup with your same user name, and Software Update to 10.6.8
    Then download and install DataRescue  ($99) onto the external 10.6 drive and attach another blank external GUID OS X extended formatted drive and run DataRescue to recover your files to that drive. There will be a lot.
    Data Rescue will read the 1's and 0's of the files themselves regardless of what your partition map says, before they are overwritten.
    After that's done, access the second external drive and pick though the files to recover.
    Once you have gotten all your data, you need to install all your third party programs on the external drive from original sources and update. Then move your files you've recovered to it.
    Once that' is all done, erase one drive and download Winclone, and clone the Bootcamp Windows to the empty drive.
    Then use Disk Utility to Erase with Zero the entire internal drive of all partitions and everything. (select the drive makers name and size on the far left) Format GUID OS x Extended Journaled like always.
    Use Carbon Copy Cloner to clone the 10.6.8 external drive to the internal drive, disconnect the external drive and boot from the internal drive and then install Lion on the internal drive. You can hold option key, click on Purchases to download Lion again.
    Use Bootcamp to set up Windows partition, then follow Winclones directions to clone Windows back into the Bootcamp partition.

  • Cannot Delete file iCloud

    I am having an issue with the New Late 2012 iMac and syncing numbers documents in the cloud.
    1) I cannot sync a native document from the new iMac to the cloud via the Numbers Program. I can drag the document into the browser and update it that way
    2) After doing this as a work around the document devlopes an error message making it unable to drag and drop 3 times seems to be the max allowed with this method
    Spent an hour on the phone with Apple to no avail, I have tried
    1) Deleteing icloud off all my devices Mini, Iphone, Ipad macbook air and iMac.
    2) Yes I have made sure Docs in the cloud is turned on on all devices and the right icloud account is signed in
    3) rebooted everything a few times
    4) created another profile on the IMac which is able to update via the Native Numbers program and not the Browser as I was doing on profile 1.
    The problem seems to be this file which is gray'd out and I cannot delete it off any device, the date that this started happening is the creation date of this document, so process of elimination I want to delete this document to see if this is corrupting profile 1 and disabling my ability to upload files via the native Numbers program.
    Anyone have a document that is in the constant update state on icloud that cannot delete it with a new Mac? Its a very frustrating problem because I use the mac as the mother ship to handle presentations and spread sheets and its not pushing out what I do on it and its brand new..Considering doing a time machine restore on the new profile to see if that works..Anyone have some more thoughts, I have tried all the simple fixes thanks to Apple and a very nice female voice named Kerry.

    This deeper than that. I created another account on the same iMac and it works in Harmony with my other devices and Documents in the cloud. I can only imagine the icloud account is somehow corrupted (I am on my macbook not iMac at the moment). There have been no updates to the Calendar, Contacts or Documents since early January on that account. I have spent 1hr on the phone with support and they were baffled as well. Only thing I can gove as insight to the problem is this, I was on the Mac Mini which was backed up on Time Machine. about 4 or 5 months ago I had to completley restore the Mac Mini becasue of the never ending circle on the load screen. The Backup failed to work it kept loading the issue and 4 or 5 times the circle of death kept coming up I would subsequently wipe the Mini and go further back in the back up until I go a copy that worked.  I then loaded the Time Mache back up into my NEW iMac and wnet from there. It took about a month for this problem I am detailing above to start happening. It maybe a corrupt file loaded from the backup into the new iMac causing this problem. Best answer I can think of on my own???

  • Adobe bridge CS5.5 cannot delete files

    Hi
    I have latest version of Lion, and recently upgraded CS3 to CS5.5. All my files under my home folder are there to view in bridge and were ofcourse created under CS3.
    If I select ANY file, I cannot delete it, or move it, or rename it, or do a batch rename.. Nothing, yet it I find it in my finder window, I can delete it.
    If I create a new .ai file which would be with CS5.5 I CAN delete it. So I am wondering what permissions are not sufficient from CS3 to CS5.5 in bridge. I have spoken to Apple Tech and they advised me to change my home folder permissions for Everyone to read and write and apply to enclosed items. That didn't work.
    I have heard there is an issue between Lion and Adobe, but not sure I buy that one. At the end of the day Bridge is just like a finder window, except it have more tools and more links to more adobe applications, but basically a file view window. Yet when I choose to view files in Finder I can delete them, except it will keep asking me to enter my user pword everytime with no option to remember it.
    The only way of getting around this so far is to manually one by one is SAVE AS each file with a new file name.. no auto script option I can see of doing it so far.
    I have ALOT of files, surely there is something I should be knowing after all these years.
    HELP!
    Dan

    Thank you, SG, for clarifying which OS's this will work with.
    I agree with Jennie - the beauty of "get photos from camera" is that it takes 2 steps out of the workaround you mention above. Personally, I'm okay living with 6.4.1, as I have an older camera. I won't be happy if one of the push updates re-updates me to 6.5 though. I wouldn't want to redo the reinstallation of the new version. This method will not work for any of my clients or students though - they normally can't comfortably follow the technicality of downgrading, and some have newer cameras and would need the 6.5 version. (I don't believe in betas for my clients, and neither do they, for the most part)
    I guess I should thank Adobe - some of my clients have needed tech support to perform the downgrade (SO many people aren't comfortable technically), and some of my clients needed to be retaught the workaround SG mentions. Adobe's flub has actually made me a little money - which I'd rather not have to make this way.
    SG's workaround does work and makes sense - but for my clients with hundreds of images at a time, who have to rename items, add copyright info, & etc., this more than doubles their work-time for the start of their workflow. I hope Adobe gets that GM version out soon.
    BTW - this issue supports an argument I've hadfor years regarding "PUSH" updates. I always tell my clients and students not to do them until they research the update. Because of what I do, I do have to install them personally, but I'm grateful I'm comfortable fixing things myself.

  • Cannot delete file from external hard drive (error code 36) in Finder, but Terminal is ok

    I have a relatively new Macbook Pro Retina 15" and have a Western Digital 1 TB Passport.  I've been using the passport for about a year now without any problems on older Macbooks in my house.  I used to be able to read and write to this drive no problem.  I am using the Paragon NTFS for Mac software in order to read and write to the NTFS drive.  When I navigate through the drive in Finder, if I try to create a new folder, I do not have a problem.  If I try to delete that folder I just created, I get this error:
    The Finder can’t complete the operation because some data in “untitled folder” can’t be read or written.
    (Error code -36)
    The folder has nothing in it whatsoever.  I just created it.  But if I go to Terminal and I run
    rm -rf "untitled folder"
    This works fine.  Why is Terminal acting different than Finder?  This does not happen on my other Macbooks.  Thanks in advance.

    Thanx for such qucik reply!!! The pages were great, it had an answer for my problem, but unfortunately it also involved me dealing with it only on the MacIntosh HD itself, not on mounted external drive I suppose... So it didn't work they say that there is an icon in the left corner indicating locked folder - I don't see any icon on it. It says you can untick the box to unlock the folder - there is no tick to be unticked. Finally, they say that if I don't have permition or rights I cannot delete it. But how do i change permittion which already says that i can read and write in it? So everything appears to be normal only I cannot delete it. there is not even any warnig telling me I don't have enough rights, it just requires the password and after me typing it in it makes the sound of scraping paper but does nothing more. I aslo had some problems with emptying Trash after being seemingly succesful with one file and had got so far to have them appear in the Trash (no clue how this one actully got there though..) I followd the advice and emptied the Trash with Terminal. The Folder is still there but it shows 0 Kb... So far so good BUT: It is still on the external drive, so I obviously only managed to copy it into the Trash!!! Phew, innit a bit too tight to poor owners, this macbook?? I want my rights back!

Maybe you are looking for