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 <context-param>'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.
>
>Still it's not being read.
>
>I am JBoss and JBoss contains log4j.jar by default and it has log4j.xml
>in
>default/conf folder.
>Probably even my application is taking log4j.xml from that location by
>default. I need to check that. Anyone who has implemented log4j for their
>applications on JBoss, pl. suggest.
>
>
>Sriram
>
>-----Original Message-----
>From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, August 27, 2003 6:52 PM
>To: Log4J Users List
>Subject: Re: Log file location
>
>
>
>Is the properties file being read at all?
>
>At 06:25 PM 8/27/2003 +0530, sriram wrote:
> >Hi,
> >
> >I am unable to set log file location. I searched the forum for old
> >messages and found some. I tried the way it was mentioned in those
> >messages, but still my problem is not solved.
> >
> >My log4j.properties file is as follows:
> >
> >log4j.rootCategory=WARN, dest1, R
> >log4j.appender.dest1=org.apache.log4j.ConsoleAppender
> >log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
> >log4j.appender.dest1.layout.ConversionPattern=%-5p: %m%n
> >
> >#### appender writes to a file
> >log4j.appender.R=org.apache.log4j.RollingFileAppender
> >log4j.appender.R.layout=org.apache.log4j.PatternLayout
> >log4j.appender.R.layout.ConversionPattern=%-5p: %m%n
> >log4j.appender.R.File=d:/jboss/errors.log
> >
> >
> >I packaged  by application as .ear and deployed it on JBoss running
> >on Win 2000.
> >
> >When I run the application, I can see the log messages on JBoss
> >console, but these messages are not getting stored in the file I've
> >specified (d:/jboss/errors.log).
> >
> >What could be the problem? In fact, initially I tried
> >${jboss.home}/errors.log, but it didn't work. So I thought of hard
> >coding the file location and tried it out. Still the same problem.
> >
> >Can someone please suggest a solution?
> >
> >Thanks
> >Sriram
> >
>
>--
>Ceki For log4j documentation consider "The complete log4j manual"
>       ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


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


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



_______________________________________

  Donald H. Larmee
  ALTERTHOUGHT, Inc.
  804.301.8867 (c)

  www.alterthought.com
_______________________________________



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


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



Reply via email to