I would like to suggest that the code which is reponsible for the loading of
a property file (or XML configuration file) be modified somewhat, since
presently it can not handle custom URL types.
Right now, the static init method in Category establishes a URL for the
property file, either from a value explicitly set in a "log4j.configuration"
system variable, or by asking the classloader to find the the
"log4j.properties" file. Once it has the URL, it then calls
OptionConverter.selectAndConfigure(url, defaultHierarchy);
OptionConverter then takes a look at the URL, and if it has a 'ref' portion,
assumes that that is the classname of a custom configurator class, and tries
to instantiate that class to handle the config file.
The problem with this scheme is that it can't handle URLs in which the 'ref'
portion is actually relevant to accessing the file.
If I have a Servlet Web App in a .WAR file and deploy it to WebLogic 6,
WebLogic will never actually expand out the log4j.properties file that is in
the /WEB-INF/classes dir inside the .WAR file. It has a custom classloader
and zip url handler that knows how to load files from within the war file.
So when the classloader is asked for the URL of log4j.properties, it returns
something like:
zip:D:/dev/bea/wlserver6.0/config/mydomain/applications/.wl_temp_do_not_dele
te/wl_local_comp7017.war#WEB-INF/classes/log4j.properties
OptionConverter then blows up on this since it assumes there is a custom
configurator class called 'WEB-INF/classes/log4j.properties', and blows up
when it can't load it.
It would be pretty simple to fix this, by checking the URL returned from the
classloader, and if it has a 'ref' section, then calling OptionConverter
with an option saying to not treat the 'ref' as a configurator class.
If people are in agreement with this, I am willing to make changes and post
them as patches...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]