DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16457>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16457

NullPointerException in LogFactory





------- Additional Comments From [EMAIL PROTECTED]  2003-01-31 00:13 -------
Now I'm curious as to the behaviour you are seeing.  At the following code 
point:

  // Fourth, try the fallback implementation class
  if (factory == null) {
    factory = newFactory(FACTORY_DEFAULT, LogFactory.class.getClassLoader());
  }

Yes, LogFactory.class.getClassLoader() may return null.  The method newFactory 
checks the class loaders, sees that it is null, and drops down to the line:

  return (LogFactory)Class.forName(factoryClass).newInstance();

which is exactly the desired behavior (Class is LogFactory.class).  If, 
instead, you pass in 'contextClassLoader', then you allow the user to override 
the factory-default by providing another implementation (same name) down the 
classloader hierarchy.  This is 'one-way' to resolve the problem, but the 
programming model is to use other methods to override...  You shouldn't NEED 
the context classloader, as LogFactory and the factory default are (suppose to 
be) in the same jar file.  If you don't have the factory default (commons-
logging-api.jar?), then this is moot anyway.

Does that help any, or am I still blind?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to