Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extend the set of reloadable directories on tomcat

I would like to extend the set of reloadable directories on tomcat 7.0.59. When reloadable attribute within Context is set to true, tomcat monitors classes in: /WEB-INF/classes/ and /WEB-INF/lib.

Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.

Entire system is divided into modules, each module can have its own web context (/WEB-INF/classes/) and/or extend the global context (/classes/). Let's say that I'd like to have /classes/ directory reloadable. How can I achieve that?

I tried using WatchedResource tag, without effect:

<Context reloadable="true" path="/test" docBase="/MY_MODULE/web/webroot">
     <Manager pathname="" />
     <WatchedResource>/MY_MODULE/classes</WatchedResource>
</Context>
like image 259
luke Avatar asked Sep 04 '17 05:09

luke


1 Answers

You can try starting tomcat with HotSwapAgent: Plugin_tomcat. (GITHUB HotswapProjects)

You can have a differrent hotswap-agent.properties file on each of your modules, to load differrent classpaths.

like image 178
Marinos An Avatar answered Nov 12 '22 14:11

Marinos An