tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptruche <>
Subject Unable to deploy app with Tomcat Manager Text interface using a Context Descriptor
Date Tue, 13 Oct 2015 15:09:13 GMT
My application context is defined as an XML file located in `my/path/to/Tomcat/conf/Catalina/localhost/my-app.xml`.
    <Context docBase='/my/path/to/myApp/myAppWarFile.war'>       <Environment
name='my_config_dir' value='/my/path/to/myApp' type='java.lang.String'/>    </Context>
`/my/path/to/myApp` contains the WAR file myAppWarFile.war and a number of externalized properties
that are read by Spring.
Tomcat is configured with autoDeploy turned off. When I start Tomcat, it creates `my/path/to/Tomcat/conf/webapps/my-app/`
and the WAR file gets unpacked into this location as expected, and the application of course
can run as expected.
When I want to deploy a new version without restarting Tomcat, I run the undeploy command
as follows:
    curl http://localhost:8080/manager/text/undeploy?path=/my-app --user my-username:my-password
... and that works. But when I instruct Tomcat to deploy with the following curl statement,
I get a failure.
    curl http://localhost:8080/manager/text/deploy?config=file:/my/path/to/Tomcat/conf/Catalina/localhost/my-app.xml
--user my-username:my-password    # Tomcat response    FAIL - Invalid context path null
was specified
Adding the path does not help much, I still get a failure.
    curl http://localhost:8080/manager/text/deploy?config=file:/my/path/to/Tomcat/conf/Catalina/localhost/my-app.xml\&path=/my-app
--user my-username:my-password
    # Tomcat response    FAIL - Failed to deploy application at context path /my-app
The worst part is that tailing catalina.out does not yield any insight. And on top of that,
Tomcat deletes the application context XML file `my/path/to/Tomcat/conf/Catalina/localhost/my-app.xml`!
Naturally I have reviewed Tomcat documentation (
and I have googled all day to figure this out, but I have not found anything that can help
me with this particular configuration.
It feels as though the choice is: 
 1. Tomcat with autoDeploy on (not recommended for production) in which case simply dropping
the new WAR to `/my/path/to/myApp/` will cause Tomcat to hot deploy the app. 2. Tomcat with
autoDeploy off, but re-deploying requires a Tomcat restart because the deploy API does not
seem to be working as advertised.
Has anybody made this work with this configuration?
I turned up the logging on Catalina. When I run the first deploy command without the path,
I get this set of log entries:
    FINE: Start processing with input [config=file:/my/path/to/tomcat/conf/Catalina/localhost/my-app.xml] 
  Oct 13, 2015 10:04:53 AM org.apache.coyote.AbstractProtocol$AbstractConnectionHandler process 
  FINE: Socket: [[addr=/0:0:0:0:0:0:0:1,port=45415,localport=8080]],
Status in: [OPEN_READ], State out: [OPEN]    Oct 13, 2015 10:04:53 AM org.apache.coyote.http11.AbstractHttp11Processor
process    FINE: Error parsing HTTP request header Unexpected
EOF read on the socket        at org.apache.coyote.http11.Http11Processor.setRequestLineReadTimeout( 
      at org.apache.coyote.http11.AbstractHttp11Processor.process( 
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process( 
      at java.util.concurrent.ThreadPoolExecutor.runWorker( 
      at java.util.concurrent.ThreadPoolExecutor$ 
      at org.apache.tomcat.util.threads.TaskThread$ 
    Oct 13, 2015 10:04:53 AM org.apache.coyote.AbstractProtocol$AbstractConnectionHandler
process    FINE: Socket: [[addr=/0:0:0:0:0:0:0:1,port=45415,localport=8080]],
Status in: [OPEN_READ], State out: [CLOSED]    Oct 13, 2015 10:04:53 AM org.apache.tomcat.util.threads.LimitLatch
countDown    FINE: Counting down[http-bio-8080-exec-16] latch=1
 Apache Tomcat 7.0.55 (but confirmed same problem with 7.0.59 and 8.0.12. Tomcat configured
to run as a service with tomcat user and group owning the catalina base and subfolders, and
the docBase folders outside of the appBase Centos 6.5
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message