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: Log4j problem with my ear - more generally a class loader question.
Date Thu, 30 Nov 2006 17:56:28 GMT
The first thing to try is to use the hidden-classes element in your  
geronimo deployment plan to not import geronimo's log4j and commons- 
logging classes.

Your geronimo-application.xml plan should start something like this:

<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/ 
application-1.1">
   <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/ 
deployment-1.1">
     <dep:moduleId>
       <dep:groupId>org.chapel</dep:groupId>
       <dep:artifactId>Chapel-jetty</dep:artifactId>
       <dep:version>1.0-SNAPSHOT</dep:version>
       <dep:type>car</dep:type>
     </dep:moduleId>
     <dep:dependencies/>


  <dep:hidden-classes>
     <dep:filter>org.apache.log4j.</dep:filter>
     <dep:filter>org.apache.commons.logging.</dep:filter>
   </dep:hidden-classes>

   </dep:environment>

...

hope this helps.

david jencks


On Nov 30, 2006, at 8:42 AM, Poulin, Maxime wrote:

> Greetings !
>
> So I am trying the very painful task of building one single ear file
> that would work properly under websphere, geronimo and some others.
>
> The ear contains 1 web app called Chapel, a few EJBs and 2 j2ee client
> apps.
>
> As we deploy on multiple containers (some of them don't have  
> log4j), we
> keep the log4j and apache commons-logging in the ear file.
>
> Now here is my problem. I created my own log4j appender which I  
> wish to
> use. The jar containing this appender is contained in the ear just  
> like
> log4j etc. Now when log4j is initialized, it is geronimo's log4j  
> that is
> used, and it does not find my custom appender (class not found). I  
> guess
> that geronimo's log4j is higher in the hierarchy, and does not look
> down.
>
> So either I make my jar visible to geronimo's log4j or I tell geronimo
> to use my own log4j instead of his for my ear.
>
> I need advice on this, advice, comments or experience. Could you  
> tip me
> ?
>
> Advices on geronimo's class loaders are also welcomed.
>
> Thank you very much.
>
> Maxime Poulin
> CGI - CGIFX
> 514-228-8800 ext.2860


Mime
View raw message