Caldarale, Charles R wrote:
From: Mikolaj Rydzewski [mailto:m...@ceti.pl] Subject: Re: JNDI: Name java:comp is not bound in this Context

So I rather think, that Tomcat fills JNDI information after webapp deployment.

Not really after, just during.  I'm still looking through the code, but the 
logger for the webapp is initialized very early in the process, which makes 
sense.

But anyway, why does log4j initialization takes place before JNDI context is ready?

The JNDI context is specific to the webapp; if errors occur during its 
population, having the webapp's logger around to record them would be 
beneficial.  One or the other has to come first, and the spec gives no guidance 
with respect to loggers, so it appears Tomcat chose to initialize the webapp's 
logger first.  Seems quite reasonable to me.
Thanks Chuck for your input.

Do Tomcat has to do anything with logger initialization? As you can see in stacktrace, I use commons-logging, log4j and common idiom:

private final static Log log = LogFactory.getLog(MyClass.class);

If I'm not wrong, log4j initialization should take place during initialization of static 'log' field. And that happens when JVM loads specific (my) class. And that can happen, for the first time, during context listeners loading. So it should happen after JNDI context population. Am I right?

I'm not arguing with you, just trying to understand the cause of my problem ;-)

--
Mikolaj Rydzewski <m...@ceti.pl>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to