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=35774>.
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=35774





------- Additional Comments From [EMAIL PROTECTED]  2005-07-19 08:35 -------
Yep, your description #5 matches my #4 (though yours is a bit better phrased :).

This makes things very ugly for commons-logging. The LogFactory keeps a map of
configurations by context-classloader. So even with your proposed fix, any app
that calls into C will cause C's LogFactory to create another LogFactoryImpl for
that classloader. That will probably prevent the calling app's classloader from
being garbage-collected among other nasty issues.

Here's some initial thoughts on a full fix for this:

Basically, if LogFactory sees that TCCL is not related to its classloader, then
it should *not* retain any strong references to that TCCL, and in particular not
use it as a key into the factories map. But if it doesn't do that, then every
time getLog() is called and it can't find an entry in its factories map then it
needs to walk the list of ancestors for the TCCL to see whether it is among
them: if yes, then this is simply the "new context" scenario; if no then this is
the "inter-app-call" scenario so it needs to ignore the TCCL and use
LogFactory.getClassLoader as the key instead.

Hmm. But there's another scenario in which the TCCL can be unrelated to the
classloader for LogFactory - the jboss "UnifiedLoaderRepository" (as explained
by Brian S.). But in that case we *must* use the TCCL in order to get sane
logging configuration behaviour (remember that the whole point of trying to load
the logging adapter classes via the TCCL is so that webapps can provide their
own adapters, and so that logging config files in the webapp-specific classpath
are seen).

Currently, I don't see *any* way to handle this with JBoss. The combination of
the UnifiedLoaderRepository and inter-app-calls where the TCCL is set to the
caller appears initially unsolvable to me - not just for commons-logging, but
for any logging system at all which can be configured on a per-app basis.

I'll give this some more thought. All suggestions on how to resolve this are
very welcome - though it might be more convenient to post them to commons-dev
(with subject line starting [logging]) rather than having a discussion on these
awkward web forms.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to