Hi Christoph,

AFAIK this is a limitation of Java when running under Windows. We have 
experienced this issue with our test cases on Windows as well. There is a bug 
in Java issue tracker about this. If I remember correctly, forcing the GC helps 
to release the file handle.

If you have a solution we are interested :) Feel free to enter a Restlet bug 
report to keep track of it.

Best regards,
Jerome
--
Restlet ~ Founder and Technical Lead ~ http://www.restlet.o​rg
Noelios Technologies ~ http://www.noelios.com




-----Message d'origine-----
De : Christoph Tornau [mailto:[email protected]] 
Envoyé : mardi 27 juillet 2010 11:02
À : [email protected]
Objet : Problem with PUT and DELETE after GET: File is not deleteable

Dear list,

I ran into the following problem:

I created a Restlet-server as described in Part06 of the tutorial (see 
attachment Part06.java).

Now I simply want to PUT , GET and PUT a ressource on this server (in this 
order). I wrote a small sample application which is also attached 
(BugTest.java). The last PUT call fails in this application:


27.07.2010 10:47:26 com.noelios.restlet.local.DirectoryResource getVariants
INFO: Getting variants for : file:///c:/restlet/docs/api//bugtest1.xml
27.07.2010 10:47:26 com.noelios.restlet.local.DirectoryResource <init>
INFO: Converted target URI: file:///c:/restlet/docs/api//bugtest1.xml
27.07.2010 10:47:26 com.noelios.restlet.local.FileClientHelper handleFilePut
WARNUNG: Unable to delete the existing file
27.07.2010 10:47:26 com.noelios.restlet.LogFilter afterHandle
INFO: 2010-07-27        10:47:26        127.0.0.1       -       -       8182    
PUT     //bugtest1.xml  -       500     306     21      0       
http://localhost:8182   Jakarta Commons-HttpClient/3.1-rc1      -


I analysed the source code of the Restlet-server. The reason for the failure is 
that after the GET some file handle remains on the file and the server is 
unable to delete it. file.delete() in Java fails.

I use Windows XP as operating system. Filesystem is NTFS. Restlet version is 
1.1.

Can someone help solving this bug?

-- 
Christoph Tornau

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2638588

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2667213

Reply via email to