At line 105 added 54 lines. |
|
!! Corrections |
Comments and suggestions are not quite correct. \\ |
I have not changed earlier contributions - instead I have added some coding samples that really work.\\ |
|
Newer distributions (Tomcat4.1.24, Tomcat4.1.27) document in detail the usage of the ant tasks, see Manager_App_HOW-TO in the tomcat-docs. \\ |
A very confusing point is the different syntax of the war attribute : In target install you need the syntax of a jar-URL: |
{{{ |
<!-- Install war file to servlet container --> |
<target name="install"> |
<install url="${managerapp.url}" |
username="${managerapp.userid}" |
password="${managerapp.password}" |
path="/${context}" |
war="jar:file:${build.dir}/${war.file}!/" /> |
</target> |
}}} |
On the other hand, the deploy target uses a simple file-URL: |
{{{ |
<!-- Deploy an application to servlet container --> |
<target name="deploy"> |
<deploy url="${managerapp.url}" |
username="${managerapp.userid}" |
password="${managerapp.password}" |
path="/${context}" |
war="file:${build.dir}/${war.file}" /> |
</target> |
}}} |
Other targets that do not require a war attribute are uncritical, eg |
{{{ |
<!-- Remove an application on servlet container --> |
<target name="remove"> |
<remove url="${managerapp.url}" |
username="${managerapp.userid}" |
password="${managerapp.password}" |
path="/${context}" /> |
</target> |
}}} |
There is one remaining problem with the undeploy target - in some circumstances the target does not complete but ends up with an error message: |
{{{ |
<!-- Undeploy an application from servlet container --> |
<target name="undeploy"> |
<undeploy url="${managerapp.url}" |
username="${managerapp.userid}" |
password="${managerapp.password}" |
path="/${CONTEXT}" /> |
</target> |
|
FAIL - Cannot remove document base for path /eai_sc |
}}} |
The reason seems to be some locking by the Tomcat server itself. While Tomcat is running, even a remove (rm -rf under Unix) doesn´t work. \\ |
As a workaround you can also use the remove task to withdraw the deployment of your webapp. |
|
~ Martin Wolf ~ |