简体   繁体   English

通过上下文文件进行Tomcat管理器部署失败

[英]Tomcat manager deployement via context file fails

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 . 我只是通过指定上下文文件来尝试通过tomcat管理器部署Web应用程序,如http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Deploy_A_New_Application_from_a_Local_Path中的tomcat 7文档中所述。 。

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 我正在向经理发出以下电话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. 并且管理器指示错误:FAIL - 指定了无效的上下文路径null。

Now I can deploy the app if I use the call that also provides the deployment url (path). 现在,如果我使用同时提供部署URL(路径)的调用,我可以部署应用程序。 However I would expect Tomcat to read my context file and determine by itself the path from the file definition. 但是我希望Tomcat能够读取我的上下文文件并自行确定文件定义的路径。

Is this an issue in the tomcat 7 manager and is there a way of bypassing this ? 这是tomcat 7管理器中的一个问题,有没有办法绕过这个?

Thanks for any pointers 谢谢你的任何指示

As far as I can tell this is a bug with Tomcat (see comment from @devlearn). 据我所知,这是Tomcat的一个错误(见@devlearn的评论)。

To work around this limitation, I ended up relying on the Tomcat restart to do the initial deployment. 为了解决这个限制,我最终依靠Tomcat重启来进行初始部署。 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. 一旦Tomcat知道了应用程序,我就可以通过停止应用程序上下文,删除webapps中的文件夹并手动将WAR文件解压缩到一个替换我删除的文件夹的新文件夹来随意重新部署。 Ansible does all this work - I can revert back to using the Tomcat API when this bug is fixed. Ansible完成所有这些工作 - 当修复此错误时,我可以恢复使用Tomcat API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM