Daryl, On 4/5/18 5:07 PM, Daryl Stultz wrote: > We are upgrading from Tomcat 6 to tomcat8-8.5.23. We deploy our apps > by preparing the fully exploded and configured directory in place > under .../webapps/. autoDeploy of apps is false. We never use war > files. > > After the app is staged we use the manager app to deploy it. This > involves an HTTP GET call to > http://localhost:8080/manager/text/deploy?path=/my-app
As per the docs[1], this only works for a previously-deployed application. Deploying a new application requires additional parameters. > This is the way we have done it for years on Tomcat 6. We've been > attempting for hours to find some combination that yields something > other than: > > AIL - Invalid parameters supplied for command [/deploy] > > Finally we got this pattern to work: stage the application under > /tmp/my-app rather than .../webapps/. Then deploy it like this: > > http://localhost:8080/manager/text/deploy?war=file:/tmp/my-app/&path=/my-app > > The critical point is that the war path, when it refers to a > directory rather than a war file must end in a trailing slash. This > is not in the documentation here: > https://tomcat.apache.org/tomcat-8.5-doc/manager-howto.html#Deploy_a_Directory_or_WAR_by_URL I think you actually want this: https://tomcat.apache.org/tomcat-8.5-doc/manager-howto.html#Deploy_a_Directory_or_War_from_the_Host_appBase No slashes necessary. > Now when we go to undeploy it like so: > > http://localhost:8080/manager/text/undeploy?path=/my-app > > > Tomcat crashes and exits with this: Tomcat crashes? > AIL - Encountered exception > [javax.management.InstanceNotFoundException: > Catalina:type=Deployer,host=localhost] Did you make this request once or twice? > Rather than spend more hours on this I'm hoping someone can tell me > the right technique for undeploying. Thanks. This is the correct technique for undeploying. > Here's the traceback: > > > 05-Apr-2018 16:49:24.442 INFO [http-nio-8080-exec-1] > org.apache.catalina.core.ApplicationContext.log Manager: > undeploy:Undeploying web application at '/das-qa-java8' 05-Apr-2018 Same application path? You've been using /my-app above, but probably in an attempt to anonymize your application. Always helps to double-check the speling. > 16:49:24.847 SEVERE [http-nio-8080-exec-1] > org.apache.catalina.core.ApplicationContext.log Manager: > ManagerServlet.undeploy[/das-qa-java8] > javax.management.InstanceNotFoundException: > Catalina:type=Deployer,host=localhost at > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095) > at > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:816) > at > com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) > at > org.apache.catalina.manager.ManagerServlet.removeServiced(ManagerServlet.java:1530) > at > org.apache.catalina.manager.ManagerServlet.undeploy(ManagerServlet.java:1440) Seems like it can't find the application. Can you start Tomcat, deploy the application, and then connect to the server using JMX? You should be able to find the application under /Catalina/Deployed/localhost, then choose "Operations" and execute the "isDeployed" operation with the argument "/my-app". It should return "true". If it doesn't something isn't quite right with your setup. For example, are you using the <Host name="localhost"> for this application? The Manager expects that it (the Manager) and your application are running under the same <Host>. Hmm... that stack trace shows that the application should have been stopped + deleted by the time this removeServiced() method is called. What do the log files say? I'm guessing something else is going wrong, such as the inability for Tomcat to remove the application artifacts from the disk. Maybe a permissions problem? The initial error is probably being masked by the exception thrown during removeServiced() (which is called in a finally{} block). -chris [1] https://tomcat.apache.org/tomcat-8.5-doc/manager-howto.html#Deploy_a_previously_deployed_webapp --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org