> From: Mikolaj Rydzewski [mailto:m...@ceti.pl] > Subject: Re: JNDI: Name java:comp is not bound in this Context > > If I'm not wrong, log4j initialization should take place during > initialization of static 'log' field.
That may be true, but there's no guarantee that your classes will be loaded in any specific order, nor that resources will be registered prior to classloading; the spec only indicates the resources will be available prior to any calls to the initialization methods of listeners and servlets. >From your stack trace, you can see that the logger is being set up very early >in the game: org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:289) org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:109) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) java.lang.reflect.Constructor.newInstance(Constructor.java:494) org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1116) org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:914) org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604) org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336) org.apache.commons.logging.LogFactory.getLog(LogFactory.java:704) org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:381) org.apache.catalina.core.StandardContext.start(StandardContext.java:4119) This is well before the resources are established, and of course before any of your listeners or servlets are initialized. You can look at the start() method of org/apache/catalina/core/StandardContext.java for details about the initialization sequence. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org