Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

Java logging problem

Thread view: 
frank - 23 Jun 2005 15:05 GMT
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 - 23 Jun 2005 15:32 GMT
oop's put "" around in prop file, sorry

> Just started to look to use the java logging and got this error and
> don't know why.  Used the example from
[quoted text clipped - 16 lines]
>
> Frank
Pete Barrett - 23 Jun 2005 19:06 GMT
>Just started to look to use the java logging and got this error and
>don't know why.  Used the example from
[quoted text clipped - 12 lines]
>    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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.