Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 10886 invoked from network); 14 Sep 2006 20:59:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Sep 2006 20:59:44 -0000 Received: (qmail 14510 invoked by uid 500); 14 Sep 2006 20:59:41 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 14479 invoked by uid 500); 14 Sep 2006 20:59:41 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 14468 invoked by uid 99); 14 Sep 2006 20:59:41 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ammulder@gmail.com designates 64.233.184.226 as permitted sender) Received: from [64.233.184.226] (HELO wr-out-0506.google.com) (64.233.184.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Sep 2006 13:59:40 -0700 Received: by wr-out-0506.google.com with SMTP id 57so1034585wri for ; Thu, 14 Sep 2006 13:59:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=WXS+lmaAy0Y4iiSWExXYJ0NyFUKUDS8HyxBgIgvTPEu68t93oPM80owQck/KE4uDOyaUMjrmGLUhF4NElFl9ba38/rhjUdxJMwgiMNbZJ0p1RfBng7kedDPRTeKbILahUdbCrN/CsjcMaESmuO+a8CMOYUIe0BlAnxhLOJVN+Xo= Received: by 10.90.118.10 with SMTP id q10mr3524316agc; Thu, 14 Sep 2006 13:59:19 -0700 (PDT) Received: by 10.90.70.16 with HTTP; Thu, 14 Sep 2006 13:59:19 -0700 (PDT) Message-ID: <74e15baa0609141359w4c83606ev5b5db866b3073401@mail.gmail.com> Date: Thu, 14 Sep 2006 16:59:19 -0400 From: "Aaron Mulder" Sender: ammulder@gmail.com To: user@geronimo.apache.org Subject: Re: Classloader Hierarchy and hidden-classes In-Reply-To: <29C45885D653D543A9B62CB419AA3C22738463@PWR-XCH-02.pwrutc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <74e15baa0609141229k121ab303q28adf37765d6016f@mail.gmail.com> <29C45885D653D543A9B62CB419AA3C22738463@PWR-XCH-02.pwrutc.com> X-Google-Sender-Auth: eedc317b32724147 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Can you define shared class loaders? We don't share class loaders across applications, and we don't appear to violate anything in J2EE (at least, as far as the J2EE TCK is concerned). What is your specific commons-logging problem? Thanks, Aaron On 9/14/06, Clough, Ray C PWR wrote: > commons-logging.jar is a particular problem. I have to produce separate > EAR file when I'm deploying on Geronimo as opposed to another server > (eg. Oracle), and commons-logging is the specific cause. Actually, I > think the problem is the non-J2EE compliant shared-classloader scheme > which seems to be the Geronimo default. If you want shared > classloaders, it would make more sense to require that that behavior > must be explicitly turned on, and it should be possible to turn it on > only for specific applications. (IMHO). > > - Ray Clough > > > -----Original Message----- > From: ammulder@gmail.com [mailto:ammulder@gmail.com] On Behalf Of Aaron > Mulder > Sent: Thursday, September 14, 2006 12:30 PM > To: user@geronimo.apache.org > Subject: Re: Classloader Hierarchy and hidden-classes > > Since we have multi-parent class loaders, it may be that there's more > than one path to the offending server-level JAR. > > For example, if you want to make commons-logging hidden, and you put the > hidden-classes at the EAR level, but the WAR has a dependency on a > database pool, then the WAR could find the server commons-logging > through either the EAR-parent path or the database-pool-parent path. > The solution in that case would be to move the database pool dependency > to the EAR too, so the hidden-classes in the EAR would work. But again, > there may be several such dependencies at the WAR level. Actually, if > it really was commons-logging, you might not be able to avoid this > problem, since the WAR will automatically depend on either the Tomcat or > Jetty module, which gives yet another route. > Hmmm. It's almost like we need a way to say "load only from EAR" or > "load only from dependency X"... > > Thanks, > Aaron > > On 9/13/06, Shan Karthic wrote: > > I am using geronimo 1.1.1-rc3. I am using the release candidate > > instead of > > 1.1 since 1.1.1 fixes GERONIMO-2125. > > > > Is there anyway I can specify, for everything under the application > > classloader (including child classloaders of the application > > classloader, such as WAR classloaders), that the classes loaded by > > application class loader are visible but not the ones loaded above the > > > application classloader? > > > > I want to hide some classes loaded by the server inside my > > application. If I use hidden-classes I am able to hide the classes > > loaded by current classloader's parents. The problem I face is if I > > use hidden-classes at WAR level it hides the same classes loaded by > > EAR/application classloader as well. If I use hidden-classes only at > > application level and not at WAR level, it does not hide the classes > > loaded by the server from the WAR class loader. It looks like child > > classloaders do not know of hidden-classes specified at parent > classloader level. Is there any reason it is so? > > > > I started out trying to force my application to use its own log4j > > configuration accessed through commons logging. So I had to hide > > org.apache.commons.logging, org.apache.log4j, > > org.apache.geronimo.kernel.log loaded by the server. An utility jar > > in the application manages references to Log objects. The utility is > used by EJBs and other utilities and WAR. > > > > I am able to get the desired behaviour by hiding the classes at both > > app level and at WAR level with inverse-classloading at WAR level. If > > > I do not hide at WAR level, WAR class loader sees the classes loaded > by the server. > > If I hide at WAR level without inverse-classloading, WAR class loader > > does not see log4j classes loaded by the app class loader. But (I > > think so but my interpretation of the diagnostic messages from commons > > > logging may be wrong), due to the way Log references are stored in a > > hierarchy of class loaders, there seems to be assignments between > > log4j classes loaded by app and WAR classloaders which results in > errors. > > > > Now the problem is, since I have enabled inverse-classloading at WAR > > level, classes loaded by WAR classloader do not see any > > config/properties files available under the EAR root. I also think > > the singleton LogManager the application uses is no longer singleton > > really as it is loaded separately by the WAR and EAR classloaders. > > > > As I see it, if I can hide the required classes at app classloader > > level, that propagates to all child classloaders without hiding the > > classes loaded the app classloader itself, that will help in resolving > > > the problem. I searched but could not find whether there is anyway to > do that. > > > > Thanks and regards, > > Shankar. > > >