I'm using Vagrant to deploy to Ubuntu Linux and try to start a tomcat8
service.
Tomcat 8 was installed by apt-get install tomcat8
.
When using the service tomcat8 start
command, I got the following error:
Job for tomcat8.service failed. See "systemctl status tomcat8.service" and "journalctl -xe" for details.
Then I tracked the systemctl status tomcat8.service
, found that:
? tomcat8.service - LSB: Start Tomcat. Loaded: loaded (/etc/init.d/tomcat8)
Active: failed (Result: exit-code) since Mon 2016-03-28 09:44:17 GMT; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 884 ExecStop=/etc/init.d/tomcat8 stop (code=exited, status=0/SUCCESS)
Process: 1312 ExecStart=/etc/init.d/tomcat8 start (code=exited, status=1/FAILURE)
Mar 28 09:44:12 vagrant-ubuntu-trusty systemd[1]: Starting LSB: Start Tomcat....
Mar 28 09:44:12 vagrant-ubuntu-trusty tomcat8[1312]: * Starting Tomcat servlet engine tomcat8
Mar 28 09:44:17 vagrant-ubuntu-trusty tomcat8[1312]: ...fail!
Mar 28 09:44:17 vagrant-ubuntu-trusty systemd[1]: tomcat8.service: control process exited, code=exited status=1
Mar 28 09:44:17 vagrant-ubuntu-trusty systemd[1]: Failed to start LSB: Start Tomcat..
Mar 28 09:44:17 vagrant-ubuntu-trusty systemd[1]: Unit tomcat8.service entered failed state.
Mar 28 09:44:17 vagrant-ubuntu-trusty systemd[1]: tomcat8.service failed.
I'm unsure of how to proceed to get my Tomcat 8 service running.
Finding cause. Most common issue with Tomcat note starting is that Java is not configured properly, user trying to start Tomcat does not have permissions to do so, or another program is using port 8080 on that server.
This issue can be caused when the tomcat8 server runs under user tomcat8 and the catalina.out was created by root.
To solve this, delete catalina.out and let tomcat8 recreate it.
This could be related to this bug. Recent versions of Java deprecate the use of endorsed directories and fail if one is specified, but Tomcat8 specifies one even if it doesn't exist. Check the log in /var/log/tomcat8/
as suggested in the comments to your question to see whether this is indeed the source of your problem. If it is, you can either wait for the bug to be fixed or try the updated catalina.sh file suggested in the linked bug report.
What I did to solve the issue :
Process: 1312 ExecStart=/etc/init.d/tomcat8 start (code=exited, status=1/FAILURE)
See tomcat's dependenciesdpkg -s tomcat8-common|grep Depends
and the system java versionjavar -version
And try to sort out things with the appropriate java version if things don't match.
If that's not the case, continue :
Never bad to start withsudo apt-get update
Check eventual running tomcat processesps aux | grep java
Test the pid you're going to killpgrep -f tomcat
Targeted actionsudo pkill -f tomcat
Start removing by typing sudo apt-get remove tomcat8-
tab.
You might find :
tomcat8-common tomcat8-user
Complete remove with ( I don't know which of these below is the most appropriate to run )sudo apt-get purge tomcat8
orsudo apt-get --auto-remove purge tomcat8
or justsudo apt-get remove tomcat8
You can alsosudo apt-get autoremove
Carefully sudo rm -r
folders like
Rebootsudo systemctl reboot
When back on track installsudo apt-get install tomcat8
Check how's goingsudo systemctl status tomcat8.service
sudo /usr/share/tomcat8/bin/version.sh
Better ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With