You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ceki Gülcü <ce...@qos.ch> on 2002/12/02 15:31:18 UTC

Re: Ceki saved my day!!! (classloader hell)

At 10:09 30.11.2002 +0000, mailinglist09@gmx.net wrote:
[snip]

>After some fiddling I found out that it is actually a class cast problem.
>
>Fortunatlly I found Ceki's "Think again" on
>http://www.qos.ch/logging/thinkAgain.html
>
>So the problem is with commons-logging, I never used it, but digester does
>#?!##!
>
>Thanks Ceki, you really saved me hours, if not days!!!

I am glad to know that my rants occasionally help someone.

>I managed to get it running by adding the log4j classes to the digester 
>jar. A
>really ugly workaround, but what could one do? So actually at runtime I have
>two Logger classes, with the same name and the same package, but they are
>different, as they are loaded by different classloaders.

Pardon me saying so but that's an ugly work around. My suggestion would be 
to put log4j.jar high in the class loader tree, and to force 
commons-logging to use log4j by setting a system property. See c-l 
documentation for more details.

>Conclusions:
>The "discovery process" of commons-logging is not only weak. it is a major 
>bug
>and annoyance! I had problems with it without ever using the logging itself,
>who would expect that?
>
>The java classloader architecture is rotten!!! This really needs to be
>changed. This will become java's number one weakness.

JBoss 3.0 attempts to solve this problem with its Unified Classloader 
architecture. When a class loader loads a class, the class is shared by all 
class loaders attached to the Unified Class Repository. It's worth looking at.

>And it needs some decent versioning!

I can't find the relevant URL but .Net supposedly solved the versioning 
problem.

>And the /lib/ext dir should be thrown away!
>(just recently came across an applet that installs a really old xml parser in
>/lib/ext !  Welcome to classloader hell!)

Obviously, it's still much better than C++ linker hell. :-)

>Michael

--
Ceki

TCP implementations will follow a general principle of robustness: be
conservative in what you do, be liberal in what you accept from
others. -- Jon Postel, RFC 793



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


log4j in EJB

Posted by Yi Chen <yi...@verizon.com>.
Using file based appender inside EJB is restricted, but has anyone tried
configuring weblogic to open the back door so that logger inside EJB can
write to a log file?

Thanks.

Yi



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>