This discussion is archived
2 Replies Latest reply: Aug 31, 2012 9:05 AM by 541426 RSS The process cannot access the file because..

541426 Newbie
Currently Being Moderated
I encountered this problem while working with the Watch Service API in Java 7. I registered a directory with Watch Service to be able to monitor any new files begin created/uploaded via copy or FTP method. The watch service kicks in as soon as it receives the watch key. However, after I obtain the context from the Watch Event when I try to read the file I get " C:\Documents and Settings\TestUser\logs\test.log (The process cannot access the file because it is being used by another process)
at Method)
     at com.skis.tests.MsgProcessor.processEvents(
     at com.skis.tests.MsgProcessor.main("

Has any one come across similar problem? All suggestions and advices are welcome.

Thanks in Advance!


  • Correct Answers - 10 points
  • Helpful Answers - 5 points