We are using log4j in a servlet in Orion. But I put the log4j class in
the Orion lib directory, because otherwise the servlet, (probably
using the extension classloader), cannot find them.

I can also put our own classes, among which extended classes of
Category and such, are in the WEB-INF/classes directory. This normally
functioned fine. But the thing is, that DOMConfigurator now cannot
find them. 

This probably has to do with using the wrong class loader.

Anyhow, I tried to change DOMConfigurator, to make it find the
classes. This involved a few changes like:
< Object instance       = Class.forName(className).newInstance();
> Object instance   = 
>Thread.currentThread().getContextClassLoader().loadClass(className).newInstance();

and then it works. 

I think though that 'getContextClassLoader' is a Java 2 method, and
therefore probably not acceptable.

I am no Java expert at all, but perhaps the solution for this problem
presented by Ted Neward in his paper 'Understanding Class.forName'
would be feasible?
(http://www.javageeks.com/Papers/ClassForName/index.html)

 greetings, 

 Michiel


-- 
Michiel Meeuwissen - NOS internet 
Mediacentrum kamer 203 - tel. +31 (0)35 6773065
http://www.mmbase.org  
http://www.purl.org/NET/mihxil/


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

Reply via email to