Java logging problem

Discussion in 'Java' started by frank, Jun 23, 2005.

  1. frank

    frank Guest

    Just started to look to use the java logging and got this error and
    don't know why. Used the example from
    http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html

    complaing about this line :
    fh = new FileHandler(table.getProperty("dbsLogFile"));

    fh is defined as follow in the class:
    private static FileHandler fh;


    java.io.IOException: Couldn't get lock for "dbslogfile.txt"
    java.io.IOException: Couldn't get lock for "dbslogfile.txt"
    at java.util.logging.FileHandler.openFiles(FileHandler.java:361)
    at java.util.logging.FileHandler.<init>(FileHandler.java:232)
    at DBS.DBS.<init>(DBS.java:107)
    at DBS.RunDBS.main(RunDBS.java:20)

    thanks,

    Frank
     
    frank, Jun 23, 2005
    #1
    1. Advertising

  2. frank

    frank Guest

    oop's put "" around in prop file, sorry

    frank wrote:

    > Just started to look to use the java logging and got this error and
    > don't know why. Used the example from
    > http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html
    >
    > complaing about this line :
    > fh = new FileHandler(table.getProperty("dbsLogFile"));
    >
    > fh is defined as follow in the class:
    > private static FileHandler fh;
    >
    >
    > java.io.IOException: Couldn't get lock for "dbslogfile.txt"
    > java.io.IOException: Couldn't get lock for "dbslogfile.txt"
    > at java.util.logging.FileHandler.openFiles(FileHandler.java:361)
    > at java.util.logging.FileHandler.<init>(FileHandler.java:232)
    > at DBS.DBS.<init>(DBS.java:107)
    > at DBS.RunDBS.main(RunDBS.java:20)
    >
    > thanks,
    >
    > Frank
    >
     
    frank, Jun 23, 2005
    #2
    1. Advertising

  3. frank

    Pete Barrett Guest

    On Thu, 23 Jun 2005 10:05:26 -0400, frank <> wrote:

    >Just started to look to use the java logging and got this error and
    >don't know why. Used the example from
    >http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html
    >
    >complaing about this line :
    >fh = new FileHandler(table.getProperty("dbsLogFile"));
    >
    >fh is defined as follow in the class:
    >private static FileHandler fh;
    >
    >
    >java.io.IOException: Couldn't get lock for "dbslogfile.txt"
    >java.io.IOException: Couldn't get lock for "dbslogfile.txt"
    > at java.util.logging.FileHandler.openFiles(FileHandler.java:361)
    > at java.util.logging.FileHandler.<init>(FileHandler.java:232)
    > at DBS.DBS.<init>(DBS.java:107)
    > at DBS.RunDBS.main(RunDBS.java:20)
    >

    When the log file is created, a separet lock file called (in your
    case) "dbslogfile.txt.lck" is also created. The Logger uses this as a
    mutual exclusion mechanism for access to the actual log file. It
    doesn't seem to have been able to create it (it would have to create
    the lock file before the log file, of course).

    A number of reasons spring to mind, notably do you have permission to
    write to the directory it will be created in? or the machine it will
    be created on? Both at the Java security level and the OS level?


    Pete Barrett
     
    Pete Barrett, Jun 23, 2005
    #3
  4. frank

    jetbrains

    Joined:
    Jun 30, 2006
    Messages:
    1
    jetbrains, Jun 30, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Siegl
    Replies:
    0
    Views:
    959
    Stefan Siegl
    Aug 27, 2003
  2. janne
    Replies:
    0
    Views:
    9,495
    janne
    Sep 10, 2004
  3. Christoph Haas
    Replies:
    0
    Views:
    450
    Christoph Haas
    Jun 12, 2006
  4. Christoph Haas
    Replies:
    1
    Views:
    457
    Vinay Sajip
    Jun 14, 2006
  5. Royan
    Replies:
    1
    Views:
    1,452
    Andrea Francia
    Apr 1, 2008
Loading...

Share This Page