Troubleshoot the Tomcat plugin
This topic provides guidance on troubleshooting the Tomcat plugin in Deploy.
Starting Tomcat
Deploy expects the Tomcat start command to return and leave Tomcat running. The default Tomcat start script will cause Deploy to hang during deployment. You can specify start and stop commands on the tomcat.Server
configuration item (CI).
For example, to start and stop Tomcat 7 when it is installed as a daemon on Unix, use ./bin/startup.sh
. On Microsoft Windows, use /bin/startup.bat
.
If your start and stop scripts only return when Tomcat is actually started or stopped, set the wait times on the tomcat.Server
CI to 0.
Tomcat as a Service
The following commands are used as a reference while setting up the Tomcat Server in Deploy. Run the "Status Command" and its output is compared against the "Expected Status Command Output" to determine if the server is running.
- "Start Command"
systemctl start tomcat9.service
- "Stop Command"
systemctl stop tomcat9.service
- "Status Command"
systemctl status tomcat9.service
- "Expected Status Command Output"
running
You can use "Status Command" and "Status Command Expected Output" along with the "Start Command" or "Stop Command" to validate Tomcat status before executing the commands.
Restarting Tomcat after deployment
If you are running Tomcat on Unix and the Tomcat server does not restart after application deployment, use the nohup
command with the sleep
option. This ensures that the SSH connection is not closed before the restart is processed.
Example:
nohup /usr/local/apache-tomcat-7.0.42/bin/catalina.sh start && sleep 2
Disabling management of context.xml
If the Tomcat plugin deploys additional files that cause conflicts, disable its management of the context.xml
file. For more information, see deployed actions table.
To disable management, locate the following line in the XL_DEPLOY_SERVER_HOME/conf/deployit-defaults.properties
file:
#tomcat.manageContextXml=true
Change the line to:
tomcat.manageContextXml=false
For more information about the Tomcat plugin, see: