tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: UPDATE - RE: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup
Date Thu, 30 Jun 2011 16:25:05 GMT
2011/6/30 Bob DeRemer <bob.deremer@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message