Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Service tomcat8 failed to start by using service tomcat8 start

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.

like image 918
Liky Avatar asked Mar 28 '16 09:03

Liky


People also ask

Why my Apache Tomcat server is not starting?

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.


3 Answers

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.

like image 175
Manuel Tijerino Avatar answered Oct 17 '22 08:10

Manuel Tijerino


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.

like image 42
beldaz Avatar answered Oct 17 '22 06:10

beldaz


What I did to solve the issue :

Process: 1312 ExecStart=/etc/init.d/tomcat8 start (code=exited, status=1/FAILURE)

See tomcat's dependencies
dpkg -s tomcat8-common|grep Depends

and the system java version
javar -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 with
sudo apt-get update

Check eventual running tomcat processes
ps aux | grep java

Test the pid you're going to kill
pgrep -f tomcat

Targeted action
sudo 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 or
sudo apt-get --auto-remove purge tomcat8 or just
sudo apt-get remove tomcat8

You can also
sudo apt-get autoremove

Carefully sudo rm -r folders like

  • /var/lib/tomcat*
  • /usr/share/tomcat*
  • /etc/tomcat*

Reboot
sudo systemctl reboot

When back on track install
sudo apt-get install tomcat8

Check how's going
sudo systemctl status tomcat8.service
sudo /usr/share/tomcat8/bin/version.sh

Better ?

like image 22
zer0mode Avatar answered Oct 17 '22 08:10

zer0mode