JDK-4958543 : Logging does not find config file from the classpath
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Future Project
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2003-11-22
  • Updated: 2007-07-21
  • Resolved: 2005-05-02
Description

Name: rl43681			Date: 11/21/2003


FULL PRODUCT VERSION :
java version "1.4.2_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03)
Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Windows NT Version 4.0

A DESCRIPTION OF THE PROBLEM :
I read a config properties file to use java.util.logging API:

System.setProperty("java.util.logging.config.file", fileName);
try {
   logManager.readConfiguration(); //refresh to use new config file
} catch (IOException ioe) {
  System.err.println("ERROR setting logging configuration file: "+ioe);
}

this works until the properties file is not in the main working directory!
even putting the directory where the properties file is stored to the CLASSPATH doesn't help!

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set the logging properties file via
System.setProperty("java.util.logging.config.file", fileName);

1. start java in the same directory where the properties file is
2. start java in a different directory than the properties file


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
having the directory with the properties file in the CLASSPATH should also make logging API find the file.
ACTUAL -
the logging API only finds the properties fiel if it's in the same directory as where the java app is started.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
ERROR setting logging configuration file: java.io.FileNotFoundException: log.properties (Das System kann die angegebene Datei nicht finden)


REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 227098) 
======================================================================

Comments
EVALUATION The orinamesginal bug report mentions the inability to find a properties file anywhere but the current directory. However you can use the Java file notation to load relative pathnames. What cannot be done today is find the properties file on the classpath, I'm reassigning this feature enhancement for a future release ###@###.### 2003-11-30
30-11-2003