commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10825] - [logging] NullPointException when Logger.getClassLoader returns null
Date Mon, 09 May 2005 16:20:42 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=10825>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=10825





------- Additional Comments From erik@ingaro.co.uk  2005-05-09 18:20 -------
Created an attachment (id=14974)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=14974&action=view)
changes LogFactory.getFactory to return same instance if classloader is null

I'm experiencing similar issues on Jeode (basically 1.1.8) where
getClassLoader() is returing null.

When this is the case LogFactory.getFactory() returns a different instance of
LogFactory each time it is called.  This means I cannot call setAttribute on a
LogFactory and expect future calls to getLog to use the same instance.

LogFactory uses a map ("factories") of 
ClassLoader->LogFactory.  Where ClassLoader == null it cannot be used as a key
in this map, therefore previously created instances are not found.

I have included a patch to fix this problem.  It adds an additional static
variable "nullClassLoaderFactory" that performs the same function as the
factories map, but for cases where ClassLoader is null.  If the factories map
is accessed and the ClassLoader is null this variable can be used instead.

This is against svn trunk.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message