I just wanted to report something I read about the JBoss class loading
scheme. You can view this information at...
http://umn.dl.sourceforge.net/sourceforge/jboss/ClassLoading.pdf
WAR Loader. The WAR Loader is a servlet container specific ClassLoader that
delegates to the Web
ENCLoader as its parent class loader. The default behavior is to load from
its parent class loader and
then the war WEB-INF/{classes,lib} directories. If the servlet 2.3 class
loading model is enabled it
will first load from the war WEB-INF/{classes,lib} and then the parent
class loader.
So, it looks as if JBoss supports being able to use the servlet-2.3 class
loading model, but you have to enable it yourself (although I didn't see
any information how exactly to do that). There is lots of other
interesting stuff in that document. For those having problems logging in
JBoss, this is a must read.
Jake
At 01:47 PM 8/29/2003 -0500, you wrote:
At 10:50 AM 8/29/2003 -0400, you wrote:
Re: Bug in jBoss
Alas. Actually/unfortunately the 2.3 (and 2.4 proposed final draft)
Servlet spec only 'suggests' that the Containers ClassLoader give
preference to the WebApp
(http://www.jcp.org/aboutJava/communityprocess/final/jsr053/):
"SRV.9.7.2 Web Application Classloader
...It is recommended also that the application class loader be
implemented so
that classes and resources packaged within the WAR are loaded in
preference to
classes and resources residing in container-wide library JARs."
Note the use of the word 'recommended' and not 'required'
Thanks for pointing that out. I guess if you hear something enough times,
it becomes "true", but I, obviously, should have gone back and read the
actual spec on this point. That is really problematic for trying to run
apps which use different versions of libraries. I wonder how JBoss users
deal with that?
FWIW, I have always ended up punting on this one and placing my log4j
configuration into the jBoss server's log4j.xml file. Perhaps jBoss 4.X
has addressed this (I have not used it yet)?
I always end up using a repository selector and doing my own configuration
from a servlet context listener and never count on default
initialization. What I'd like to find out is if JBoss includes its own
repository selector an server startup. It doesn't sound like it does at
this point. That is where the InitContextListener from logj4-sandbox
comes in. It attempts to install a repository selector if one is provided
in the 's used by InitContextListener.
Hmm... I need to learn more about logging in JBoss.
Jake
At 02:05 AM 8/28/2003 -0500, Jacob Kjome wrote:
Well, if you your app is seeing jboss/lib/log4j.jar in preference to
WEB-INF/lib/log4j.jar, then there is a bug in JBoss. The Servlet spec
states that (contrary to the normal Java2 classloading scheme) classes
and libraries in WEB-INF/classes and WEB-INF/lib are checked first for
classloading and if the classes are not found there, only then does it
look to a higher classloader to attempt to load the classes.
I know JBoss has some concept of a single classloader across the whole
server (I think that is what I read), but if it doesn't allow for a
separate WebappClassLoader, then I think it is a spec compliance
violation. What does the JBoss group have to say about this? Putting
log4j.jar in WEB-INF/lib *should* provide a completely separate logging
environment from the one JBoss uses.
Jake
At 12:09 PM 8/28/2003 +0530, you wrote:
Hi Jake,
Thanks for the information. I have gone through the stuff you've written.
Here's what I'm doing:
1. I placed log4j-1.2.8.jar in WEB-INF/lib
2. I placed log4j.properties in WEB-INF/classes
3. I deployed the application on JBoss 3.2.1
By default, JBoss has log4j.jar in jboss/lib which is in my classpath.
So, even my application class loader takes the classes from log4j.jar
located in jboss/lib?
If I remove log4j.jar in jboss/lib, then I think I will not get server
log of JBoss.
How to solve this issue? Please inform.
Sriram
-Original Message-
From: Jacob Kjome [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 28, 2003 11:00 AM
To: Log4J Users List
Subject: RE: Log file location
Hi Sriram,
Do you have log4j.jar in WEB-INF/lib? If not, I'd expect default
initialization not to work. Remember that the webapp class loader can see
parent class loaders, but the parents cannot see the webapp class loader,
hence your log4j.properties will definitely not be found. If you are
trying to use log4j.jar in a parent class loader and want your own
configuration file to be used in your own logging space, then you will need
to use a repository selector. See the log4j-sandbox for working
examples. I wrote something up about this stuff here...
http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/AppContainerLogging
Jake
At 09:35 AM 8/28/2003 +0530, you wrote:
>The properties file is not being read at all
>
>I placed it in WEB-INF/classes.
>
>S