You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by James Vera <Jv...@dicarta.com> on 2001/08/08 21:04:32 UTC

RE: Re[2]: log4j and J2EE problem

>JV> My understanding from the Weblogic documentation,
>JV> http://e-docs.bea.com/wls/docs61///programming/packaging.html#1051556,
is
>JV> that Weblogic uses two classloaders per application.  One for EJBs and
one
>JV> for the webapp with the webapp's class loader being a child of the
EJB's
>JV> class loader.
>
>JV> So, how are people initialing log4j so that there is a single singleton
per
>JV> application in Weblogic?

>There indeed 2 classloaders, but if you put log4j.jar in the weblogic
>classpath during startup, there is only one instance. We use log4j for
>some weblogic plugins and several applications (some in .ear format,
>others as an expanded dir) and they all use the same log4j singleton.

That's true, but putting log4j.jar (or any other jar for that matter) in the
weblogic classpath is a fairly course operation.  You end up forcing all
applications to share the same log4j and they might have inconsistent uses
(I assume).  And this isn't an option when you are hot deploying an
appication into an already running Weblogic appserver.  I know there is some
way to put a third party jar into the EJB classloader of a deployed app (the
above reference discusses the advantages of this approach) but I do not know
what the mechanism is.  If anyone does I'd appreciate a pointer.

James

Re[4]: log4j and J2EE problem

Posted by Merg <me...@merg.be>.
Hello James,

Wednesday, August 08, 2001, 12:04:32 PM, you wrote:

JV> That's true, but putting log4j.jar (or any other jar for that matter) in the
JV> weblogic classpath is a fairly course operation.  You end up forcing all
JV> applications to share the same log4j and they might have inconsistent uses
JV> (I assume).  And this isn't an option when you are hot deploying an
JV> appication into an already running Weblogic appserver.  I know there is some
JV> way to put a third party jar into the EJB classloader of a deployed app (the
JV> above reference discusses the advantages of this approach) but I do not know
JV> what the mechanism is.  If anyone does I'd appreciate a pointer.

You are indeed forcing the same version of log4j for all applications.
Redeployment though works fine (web-apps, EJB seperatly, whatever) if
they all use the same factory. We now need log4j in the AS classpath because we use it in the WebLogic
plugin classes (Security Realm/startup classes/...), but I'm also
interested in this classloader mechanism.

-- 
Regards,
Merg


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org