Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 57384 invoked from network); 10 Oct 2005 16:28:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Oct 2005 16:28:00 -0000 Received: (qmail 6002 invoked by uid 500); 10 Oct 2005 16:28:00 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 5939 invoked by uid 500); 10 Oct 2005 16:27:56 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 5927 invoked by uid 99); 10 Oct 2005 16:27:55 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2005 09:27:55 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.12.11.95] (HELO smtp006.mail.ukl.yahoo.com) (217.12.11.95) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 10 Oct 2005 09:27:56 -0700 Received: (qmail 43859 invoked from network); 10 Oct 2005 16:27:28 -0000 Received: from unknown (HELO ?192.168.1.31?) (reinhard?poetz@62.178.239.20 with plain) by smtp006.mail.ukl.yahoo.com with SMTP; 10 Oct 2005 16:27:27 -0000 Message-ID: <434A966E.5060507@apache.org> Date: Mon, 10 Oct 2005 18:27:26 +0200 From: Reinhard Poetz User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: [RT] Clarifying classloading in 2.2 [was Re: Classloader changes] References: <434A73A1.9050604@apache.org> In-Reply-To: <434A73A1.9050604@apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Carsten Ziegeler wrote: > I hope that we can remove some of the old class loader/class path > handling in 2.2 and make everything simpler. > > In 2.1.x we had a boolean parameter (in web.xml) which could be used to > set the Cocoon class loader (the one used to instantiate Cocoon) as the > thread context class loader. > > In addition, we could define extra class paths in web.xml (containing > directories/jars I think) which were added to the class path as well and > finally we have parameters to force load classes (e.g. for jdbc drivers). > > With real blocks I think we should always add our class loader as the > thread context CL (this is the current implementation) and we should > forget about defining additional class paths. yes, with the rise of blocks there shouldn't be a need for this anymore. > I'm not sure about the force loading stuff. I'd skip it. > > In addition I think we should always use the paranoid class loader to > avoid class loading problems. A common problem are either Xalan and > Xerces where you forgot to put the latest version (used by Cocoon) into > the endorsed lib. Or if the application server uses his own version of > let's say commons-logging/log4j and you want to use a different one in > Cocoon. +1 > > So, the most important question is: does using an own class loader > inside a web app work in all engines, is it allowed, and is it allowed > to set the thread context CL? Unfortunatly the spec doesn't say anything whether using your own classloader is allowed or not: [...] J2EE.6.2.4.8 Context Class Loader --------------------------------- This specification requires that J2EE containers provide a per thread context class loader for the use of system or library classes in dynamicly loading classes provided by the application. The EJB specification requires that all EJB client containers provide a per thread context class loader for dynamicly loading system value JDBC™ 2.0 Extension Requirements 87 classes. The per thread context class loader is accessed using the Thread method getContextClassLoader. The classes used by an application will typically be loaded by a hierarchy of class loaders. There may be a top level application class loader, an extension class loader, and so on, down to a system class loader. The top level application class loader delegates to the lower class loaders as needed. Classes loaded by lower class loaders, such as portable EJB system value classes, need to be able to discover the top level application class loader used to dynamicly load application classes. We require that containers provide a per thread context class loader that can be used to load top level application classes as described above. [...] -- Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach {Software Engineering, Open Source, Web Applications, Apache Cocoon} web(log): http://www.poetz.cc -------------------------------------------------------------------- ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de