geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: SLF4J in geronimo
Date Fri, 28 Nov 2008 22:59:50 GMT

On Nov 27, 2008, at 9:05 AM, Ceki Gulcu wrote:

>
> Hello all,
>
> I am trying to understand how Geronimo deals with slf4j
> classes. First, I am totally unfamiliar with Geronimo's class loader
> architecture. For obscure reasons, I have placed slf4j-api-1.5.6.jar
> in $JAVA_HOME/jre/lib/ext and have commented out the following lines
> from gsh-classworlds.conf
>
>    #load ${gshell.home}/lib/slf4j-api-*.jar
>    #load ${gshell.home}/lib/slf4j-log4j12-*.jar
>    #load ${gshell.home}/lib/jcl104-over-slf4j-*.jar
>    #load ${gshell.home}/lib/log4j-*.jar
>
> Admittedly, placing slf4j classes under jre/lib/ext is not something
> one should do. However, it allows me to override Geronimo's copy of
> SLF4J with my own, as well as exporting slf4j classes to applications
> running under Geronimo.
>
> In this unusual setting Geronimo initializes itself
> successfully. However, when a web-app contained in an .ear file
> initializes, a *new* instance of SLF4J classes are loaded into
> memory. The ear file does does not contain slf4j-api.jar, not in the
> ear nor in the war file. I have checked and double checked this.
>
> Thus, it seems to me that Geronimo is keeping one instance of SLF4J
> classes for its own use and another instance for the applications it
> hosts. Is my hypothesis correct?

Geronimo is not doing this intentionally.  I don't know why this would  
be happening.  If you can figure out I'd like to know why.

One thing to note is that if you are starting geronimo via gshell 2  
vms are starting -- one for gshell, and one for geronimo.  I think the  
gsh-classworlds.conf file is only affecting the gshell classpath, not  
the geronimo classpath.

Normally the procedure for upgrading jars is explained here:  http://cwiki.apache.org/GMOxDOC22/how-to-upgrade-jars-and-swap-modules.html

However I believe the slf4j classes are loaded extremely early so  
logging is available during most of server startup so this procedure  
may not work for them.

One sure way to get the classes you want is to change the slf4j  
version in the root pom and build your own geronimo snapshot.

Could I ask what you are investigating?

many thanks
david jencks

>
> -- 
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework  
> for Java.
> http://logback.qos.ch


Mime
View raw message