CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How to resolve the "java.io.IOException" issue while creating the FileHandler?

  1. #1
    Join Date
    Jun 2009

    How to resolve the "java.io.IOException" issue while creating the FileHandler?

    Hi All,

    fh = new FileHandler(fileName,limit,numLogFiles,true);

    //filename value is /ifs/data/import/nas/qa_ha/inbound/25/VOD/log/Imransonyadi720_1272910261.log

    I am getting the below error when the above code is executed.

    java.io.IOException: Couldn't get lock for /ifs/data/import/nas/qa_ha/inbound.0/25/log/Imransonyadi720_1272910261.log
    at java.util.logging.FileHandler.openFiles(FileHandler.java:387)
    at java.util.logging.FileHandler.<init>(FileHandler.java:361)

    it appends the ".0" to given filename at the time of creation of FileHandler. It is appending ".0", but then it is appending after "inbound" string. It should append in end of the filename.

    This issue is not coming frequently.Please let me know how to avoid this issue?


  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999

    Re: How to resolve the "java.io.IOException" issue while creating the FileHandler?

    Shouldn't you be using the generation number pattern '%g' to specify the generation number position? e.g.

    filename = "/ifs/data/import/nas/qa_ha/inbound/25/VOD/log/Imransonyadi720_1272910261%g.log";

    Good teaching is more a giving of the right questions than a giving of the right answers...
    J. Albers
    Please use &#91;CODE]...your code here...&#91;/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)