4

I have installed the following distribution of Tomcat: http://mirror.its.dal.ca/apache/tomcat/tomcat-8/v8.5.4/bin/apache-tomcat-8.5.4.tar.gz

I have followed this instruction step by step: https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04

And I have started the service by using the command sudo systemctl start tomcat, I have got the following error:

Job for tomcat.service failed because the control process exited with error code. See "systemctl status tomcat.service" and "journalctl -xe" for details.

Thank you for your help in advance!

5 Answers 5

9

Make user 'tomcat' owner of the whole tomcat directory using below command:

cd /opt && sudo chown -R tomcat tomcat/

It worked for me.

2

In my case I forgot to change the value for JAVA_HOME in /etc/systemd/system/tomcat.service to match my servers JAVA_HOME. Changed it and everything is up and running fine.

1
  • 1
    I my case the problem was also the wrong jvm directory
    – Al-Alamin
    Jul 5, 2018 at 17:18
0

This appears to be a permission problem you should run the following command

sudo chmod -R +x tomcat/

I followed the directory structure in the tutorial (at digitalocean) you are following. You may replace the tomcat/ dir with you own installation dir

3
  • 2
    looks like a bad idea to me... I don't think you want the files inside the directory to be executable, especially not for everyone...
    – Zanna
    Dec 7, 2016 at 23:35
  • Well then you can run the command just on the .sh scripts but this solves the problem
    – Fenn-CS
    Dec 8, 2016 at 9:07
  • chown -hR user:group tomcat - did the trick for me :)
    – Davidenko
    Jun 13, 2017 at 11:54
0

On executing systemctl start tomcat

You'll get [Your Issue]

Job for tomcat.service failed because the control process exited with error code. See "systemctl status tomcat.service" and "journalctl -xe" for details.

Following above instruction on executing journalctl -xe you'll get following result:

Tomcat appears to still be running with PID *PROCESS_ID*. Start aborted.
If the following process is not a Tomcat process, remove the PID file and try again:
UID        PID  PPID  C STIME TTY          TIME CMD
root       982     1  0 09:51 ?        00:00:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant

Kill the process using (982 is process ID shown in journalctl's result)

sudo kill -9 *PROCESS_ID*

Then execute

systemctl start tomcat to start tomact.

Apache tomcat is up and running.

But this may disable 802.x supplicant which disables WiFi.

To resolve this, execute

sudo service network-manager restart

Hope this helps!

0

At least in Ubuntu and other OS (like CentOS), I got this problem was related to execution permissions for the scripts in the bin folder. In this case, apart from changing the owner to the user tomcat, you have to provide execution permissions to the scripts in the ${TOMCAT}/bin folder, in particular to the startup.sh and shutdown.sh scripts. Assuming the Tomcat package has been extracted in /opt/tomcat, then:

sudo chmod 755 /opt/tomcat/bin/*.sh 

After that

sudo systemctl start tomcat

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .