You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tanel Käär <Ta...@nortal.com> on 2012/09/07 13:19:00 UTC

Parallel deployment in tomcat 7 using manager-script

Hi!

I ran into a problem trying to set application context version 
<http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Parallel_deployment> using manager-script 
<http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Configuring_Manager_Application_Access> "tools-friendly 
plain text" requests in Tomcat 7.0.29. The deploy section 
<http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Deploy_A_New_Application_Remotely> states that the tag 
attribute could behave the same way as using the /app_context/##/context_version/.war pattern in uploaded war-s:

"

  * |tag|: Specifying a tag name, this allows associating the deployed webapp with a *version number*. The application
    version can be later redeployed when needed using only the tag.

"

  After deploying the app using wget, context version is not available. So I peeked  into ManagerServlet source and this 
is what I saw:

org.apache.catalina.manager.ManagerServlet 
<eclipse-javadoc:%E2%98%82=Tomcat%207.0.30/%3Corg.apache.catalina.manager%7BManagerServlet.java%E2%98%83ManagerServlet>#doGet
..
         if (command == null)
             command = request.getServletPath();
         String config = request.getParameter("config");
         String path = request.getParameter("path");
         ContextName cn = null;
         if (path != null) {
             cn = new ContextName(path, request.getParameter("*version*"));
         }
         String type = request.getParameter("type");
         String war = request.getParameter("war");
         String tag = request.getParameter("*tag*");
...
         // Process the requested command (note - "/deploy" is not listed here)
         if (command == null) {
writer.println(smClient.getString("managerServlet.noCommand"));
         } else if (command.equals("*/deploy*")) {
             if (war != null || config != null) {
                 deploy(writer, config, *cn*, war, update, smClient);
             } else {
                 deploy(writer, *cn*, *tag, *smClient);
             }
         } else if (command.equals("/list")) {
...

This reveals an undocumented attribute "version", which instead of "tag" is used to get context version. I suggest 
someone fixes current manager-howto  documentation, hopefully it saves some time :)
-- 
*Tanel Käär*
Senior developer
Tanel.Kaar@nortal.com <ma...@nortal.com>  | +372 56790907 <tel:+37256790907>  |  Skype: sntina <skype:sntina>
*Nortal AS*  | www.nortal.com <http://www.nortal.com/>  |  Raatuse 20, Tartu 51009, Estonia


Re: Parallel deployment in tomcat 7 using manager-script

Posted by Mark Thomas <ma...@apache.org>.
On 07/09/2012 12:19, Tanel Käär wrote:

> This reveals an undocumented attribute "version", which instead of "tag"
> is used to get context version. I suggest someone fixes current
> manager-howto  documentation, hopefully it saves some time :)

Done.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org