On Thu, Apr 14, 2011 at 3:41 AM, Christopher Schultz < ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Afkham, > > On 4/13/2011 10:05 AM, Afkham Azeez wrote: > > We are using Embedded Tomcat 7.0.11. It seems that with Embedded Tomcat, > the > > default is parent-first class loading, even though the default in the > Tomcat > > binary distribution is child-first. > > Yes. If you are hosting a Tomcat container, it is your job to make sure > that the system classpath is sane. > > > Is there a way to setup child-first class loading in Embedded Tomcat? > > Tomcat will always follow the servlet standard by searching the system > classloader first, then the webapp classloader, then the parent of the > webapp classloader. > > http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html > > Search for the word "therefore" and you'll see it laid-out in plain > English. > > Thanks Chris. Yes, our mistake was to put everything into the system classloader (classpath). We have solved it with a bootstrap mechanism similar to the one used in standard Tomcat. Thanks. > It appears from your reference (in a followup post to your own) that you > can set the context classpath of the thread that launches Tomcat and > effectively change the "system" classpath as Tomcat sees it. > > Be careful with these things and always make sure you test everything: > ClassLoading issues can cause unexpected behavior. > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk2mH6QACgkQ9CaO5/Lv0PCiRACgv0pOl0xFGPuLOQdDBRkqjHxS > Tu4AnRHS/aAs0F5jdtNIV86TT2hX7xai > =PN5V > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -- *Afkham Azeez* Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com, * * *Member; Apache Software Foundation; **http://www.apache.org/*<http://www.apache.org/> * email: **az...@wso2.com* <az...@wso2.com>* cell: +94 77 3320919 blog: **http://blog.afkham.org* <http://blog.afkham.org>* twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez> * linked-in: **http://lk.linkedin.com/in/afkhamazeez* * * *Lean . Enterprise . Middleware* * *