3

I'm trying to deploy a web app via tomcat manager by only specifying the context file, as described in the tomcat 7 documentation at http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Deploy_A_New_Application_from_a_Local_Path.

I'm issuing the following call to the manager http://myhost.mydomain.com:8080/manager/text/deploy?config=file:/opt/company/product/conf/mycontext.xml

The context file looks like the following :

<!DOCTYPE project>
<Context path="/myapp" docBase="/opt/company/product/lib/myapp.war" antiResourceLocking="false" >
</Context>

And the manager indicates an error : FAIL - Invalid context path null was specified.

Now I can deploy the app if I use the call that also provides the deployment url (path). However I would expect Tomcat to read my context file and determine by itself the path from the file definition.

Is this an issue in the tomcat 7 manager and is there a way of bypassing this ?

Thanks for any pointers

devlearn
  • 1,725
  • 2
  • 17
  • 30
  • My question is very similar: http://stackoverflow.com/questions/32877935/how-to-deploy-a-tomcat-application-with-url-api-when-using-custom-context-xml. – Philippe Oct 09 '15 at 17:59
  • In my case when I add path=/my-path I get a `FAIL - Failed to deploy application at context path /my-path` – Philippe Oct 09 '15 at 18:02
  • 1
    Seems it is a tomcat bug, still not closed since 6.0 : https://bz.apache.org/bugzilla/show_bug.cgi?id=51727 . There is an interesting discussion here http://tomcat.10.x6.nabble.com/manager-deploy-context-file-td2062544.html , so basically the path element cannot be used in the context config file ! – devlearn Nov 16 '15 at 16:31

1 Answers1

1

As far as I can tell this is a bug with Tomcat (see comment from @devlearn).

To work around this limitation, I ended up relying on the Tomcat restart to do the initial deployment. Once Tomcat is aware of the application, then I can redeploy at will by stopping the application context, deleting the folder in webapps and manually unzipping the WAR file into a new folder that replaces the one I deleted. Ansible does all this work - I can revert back to using the Tomcat API when this bug is fixed.

Philippe
  • 4,088
  • 4
  • 44
  • 49