You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Daryl Stultz <da...@opentempo.com> on 2018/04/05 21:07:45 UTC

Manager app text mode refuses to deploy

Hello,


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


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


Now when we go to undeploy it like so:


http://localhost:8080/manager/text/undeploy?path=/my-app


Tomcat crashes and exits with this:


AIL - Encountered exception [javax.management.InstanceNotFoundException: Catalina:type=Deployer,host=localhost]


Rather than spend more hours on this I'm hoping someone can tell me the right technique for undeploying. Thanks.


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 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) at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:364) at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:595) at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:348) at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:52) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) at org.apache.tomcat.util.net.SocketProcessorBase.run<http://org.apache.tomcat.util.net.socketprocessorbase.run/>(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run<http://worker.run/>(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run<http://wrappingrunnable.run/>(TaskThread.java:61) at java.lang.Thread.run<http://java.lang.thread.run/>(Thread.java:748)

Apache Tomcat 8 (8.5.29) - Manager App HOW-TO<https://tomcat.apache.org/tomcat-8.5-doc/manager-howto.html#Deploy_a_Directory_or_WAR_by_URL>
tomcat.apache.org
If you have Tomcat configured to support multiple virtual hosts (websites) you would need to configure a Manager for each. There are three ways to use the Manager web application.





--

Daryl Stultz
Principal Software Developer
_____________________________________
OpenTempo, Inc
http://www.opentempo.com<http://www.opentempo.com/>
mailto:daryl.stultz@opentempo.com<ma...@opentempo.com>


Re: Manager app text mode refuses to deploy

Posted by Daryl Stultz <da...@opentempo.com>.

> As per the docs[1], this only works for a previously-deployed
> application. Deploying a new application requires additional parameters.

It's not super clear in the docs, the section "Deploy a previously deployed webapp" is the first item under the header "Deploy A New Application from a Local Path". We weren't doing anything different from Tomcat 6 so it seems a fair misunderstanding.

> 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.

Yes, that's true, we are now staging to an intermediate directory and it seems to be happier now. The slash was a misdirection, we had to double quote the full URL, I think wget was mangling it.


> Tomcat crashes?

> Did you make this request once or twice?

I don't know, things might have been in a bad state prior to the undeploy attempt.

> 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.

Yeah, my-app was a cover for the real name das-qa-java8.


>Seems like it can't find the application.

> I'm guessing something else is going wrong,

Probably true. After working out the correct manager app calls, cleaning out deploys and the work directory everything seems to be working now. We'll see how stable it is.

Thanks for your help.

/Daryl

Re: Manager app text mode refuses to deploy

Posted by Christopher Schultz <ch...@christopherschultz.net>.
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org