9
votes

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.

4
are there any logs in /var/log/tomcat8/?dahrens
I found that I couldn't start tomcat8 using service tomcat8 start but for some reason it would start using /etc/init.d/tomcat8 start. Not sure that will help you though...IpsRich

4 Answers

3
votes

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.

2
votes

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.

2
votes

Verify your tomcat8 configuration file in /etc/default/tomcat8. See if there are badly configured variables.

For me, this error was caused by the following variables in my configuration file:

-Djava.awt.headless=true -XX:+UseConcMarkSweepGC
JAVA_OPTS="-Djava.awt.headless=true -Xss4m -Xmx2g -XX:+UseConcMarkSweepGC"

I commented and it worked.

1
votes

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 ?