Enable autoDeploy on context Tomcat 7

Go To StackoverFlow.com

2

I've been reading that enabling the autoDeploy option will cause to hot deploy an app when putting a new war file. If I just want to set autoDeploy in just one app and not in the entire server I'm supposed to enable it in <app>/META-INF/context.xml am I right?

If so, the file should look like which one of the following?

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/TestApp">
    <autoDeploy>true</autoDeploy>
</Context>

or

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/SRC_RichFaces" autoDeploy="true">
</Context>

When I try either, there's a warning [SetContextPropertiesRule]{Context} Setting property 'autoDeploy' to 'true' did not find a matching property.

Any advice?

UPDATE

Sorry for the inconvenience, I misunderstood the documentation. I have to enable the <Host> attribute autoDeploy.

So I should have in the context.xml something like

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/TestApp"/>
<Host autoDeploy="true"/>

am I right?

2012-04-04 18:47
by BRabbit27
I'm not sure if autoDeploy can be set for an app. It's usually set at the server level to instruct tomcat to look for changes to/addition of war files in the base location. If autoDeploy is disabled at the server level, tomcat will not even know that a web-app with a context.xml with autodeploy=true has been dropped in the base location. And, by the way, the app specific location of context.xml is /META-INF/context.xmlsrkavin 2012-04-04 19:09


8

You can not do what you are trying to do. autoDeploy is only configurable per Host, not per Context.

The closest you could get is to enable autoDeploy for the Host's appBase and place the apps where you want autoDeploy enabled in the appBase and the other applications outside the appBase. These would then need to be deployed by adding context.xml elements under $CATALINA_BASE/Catalina/localhost

E.g. to deploy my app this way you'd create the file:
$CATALINA_BASE/Catalina/localhost/myapp.xml
with the contents:

<Context docBase="/absolute/path/to/myapp.war" >
2012-04-05 13:54
by Mark Thomas
Thanks that helped me - BRabbit27 2012-04-09 22:44
Ads