Sample Header Ad - 728x90

Starting tomcat hangs on boot , but run successfully in command line

0 votes
3 answers
2504 views
I installed tomcat9 on ubuntu 16.04, which start normally on command line, sudo /usr/local/tomcat9/startup.sh and all projects in webapps can be loaded. However, it always hangs on loading "webapps/docs" if i try to start it on OS boot. Here's the snapshot of catalina.out: catalina.out ---------- I've tried 3 kinds of methods to auto-start tomcat. 1. setup a service in diretory init.d ------------------------------------- 1) Copy file "catalina.sh" into "/etc/init.d", and rename it to "tomcat" 2) add Evirement Virables to this file: CATALINA_HOME=/usr/local/tomcat9 JAVA_HOME=/usr/lib/jvm/jdk1.8.0_111 3) use command service tomcat start 2. setup a service in systemd ----------------------------- 1) edit file "/etc/systemd/system/tomcat.service" enter image description here 2) load configuration in command line systemctl daemon-reload systemctl start tomat 3) check status systemctl status tomat which shows tomcat service start successfully 3. Setup "rc.local" service first, and add start script in "rc.local" file ------------------------------------------------------------------------ 1) edit file "/etc/systemd/system/rc-local.servic" [Unit] Description=/etc/rc.local Compatibility ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.target 2) edit file "/etc/rc.local " sudo /usr/local/tomcat9/bin/startup.sh 3) enable "rc.local" service sudo systemctl enable rc-local.service 4) reboot All these methods gave the same result: tomcat started, but loading webapps imcomplete, hanging on loading the first app "docs". I have no idea on it, please help.
Asked by songofhawk (1 rep)
Mar 3, 2017, 12:15 AM
Last activity: Jul 27, 2025, 12:01 PM