users@glassfish.java.net

Application in ear does not load log4j.xml as expected (classloading issue)

From: <glassfish_at_javadesktop.org>
Date: Wed, 11 Apr 2007 01:02:37 PDT

Hi,

I getting a strange, classloader related problem.

My deployment consists of one RAR and one EAR
- RAR is genericjmsra + Activemq. (I put all deps into the rar, including log4j, jcl)
- EAR is our own application.
Two deployment both include commons-logging + log4j.

When deploying the ear, log4j.xml in .rar is used, rather than the one
included in the ear (I include log4j.xml in the myejb.jar, which included in the ear)

So, as I can see, the classloader universe is shared for both the ear and the rar,
Am I right??

If I want to enclose my application (ear) specific log4j.xml in the .ear, what can I do.
I think that, putting logging config (which are specific with my apps) into the RAR
is not a sane approach.

Also, I've read the developer guide which talks about classloader universe.
Is it true that, if I deploy an EAR, all the lib inside is loaded with one AppClassLoader?
How about RAR, it haven't mentioned about RAR?

Finally, if my rar consists of a few dependency, should I package all the dep of the RAR
into one unit.
Just put all dep into the rar?

Thanks in advance
Zarick
[Message sent by forum member 'zarick' (zarick)]

http://forums.java.net/jive/thread.jspa?messageID=211828