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 Christian Hufgard <ch...@gmx.de> on 2004/02/06 14:38:20 UTC

Problems with Classloader

Hi folks,

I know, this question is not really log4j-specific, but using log4j made me
have this problem *G*

I have the following structure:
shared/classes/log4j.app1.properties
webapps/app1/WEB-INF/classes/ServletXY
webapps/app1/WEB-INF/lib/log4j.jar
webapps/app1/WEB-INF/lib/my.jar

ServletXY calls a class from my.jar. This class reads log4j.app1.properties
and initializes log4j. So far, everything works fine. But the called class
also does some job, that is common for all webapps on this server (e.g. reading
log4j.appX.properties ...) so my structure should look like this:
shared/lib/my.jar
shared/classes/log4j.app1.properties
webapps/app1/WEB-INF/classes/ServletXY
webapps/app1/WEB-INF/lib/log4j.jar

But now I have the problem, that the called class from my.jar cannot find
the log4j-library located in WEB-INF/lib.

Is there any way to bypass this problem? Can I tell the Classloader in any
way to took in the directory I want it to look in? If i place my.jar back to
WEB-INF/lib I cannot use the feature that it creates an instance of a given
class that is common for all webapps, or can I do so?

Greets,

Christian

-- 
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org