Thank you! Since it looks like I need to create my own classloader [to get it to check my extensions folder "on the fly"], can you point me to some links or samples that show how to do this? I can't believe more people haven't had to dynamically load JAR(s) to resolve classes "on the fly" for extensible applications that need to remain running.
-bob -----Original Message----- From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] Sent: Thursday, June 30, 2011 12:25 PM To: Tomcat Users List Subject: Re: UPDATE - RE: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup 2011/6/30 Bob DeRemer <bob.dere...@thingworx.com>: > I was able to get this to work. I had a hunch, so I moved the extensions > folder outside the WEB-INF directory. Any idea why these extra > repositories cannot be under the WEB-INF/lib folder ? I think classes should be loadable, but IIRC annotation and resources scanning won't work for the. There was a bug about that and it was closed as WONTFIX. The short version is that it is hard to differ between app's own WEB-INF and your directory, and WEB-INF is explicitly skipped to avoid scanning it twice. > > Also, ONE OTHER QUESTION: > > Is there a way to have new JAR(s) that get dropped into the extensions folder > picked up automatically [without] restarting the webapp or tomcat? No, it is not possible. You need to restart the webapp. > We'd like to have the classloader actually fallback to reading from this > extensions location if I can't load it normally. > * would this require a custom classloader that derived from > VirtualWebappLoader - so it would pickup existing extensions at startup, but > could also check/load the JAR(s) dynamically if it can't load them? > ** if it does require a custom classloader, can someone point me to an > example of how to do this? YMMV. You may start reading with the ones implemented by Tomcat. There is classloader for JSPs that supports reloading (if JspServlet is being run in "development"=true mode). VirtualWebappLoader is not a classloader. It is just a component that configures one. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org