Looking at this phrase Job for tomcat.service failed because the control process exited with error code. kindly below are some options to follow to troubleshoot the error you are facing:
kindly remove ‘/jre’ from JAVA_HOME in ‘tomcat.service’ file and the service will start. just incase it exists.
Ensure Java version has not been updated automatically which changed the java path.
Just incase you have added the following line in your tomcat service: Environment="JAVA_HOME=/usr/lib/jvm/default-java" kindly replace it with the actual version of java you are using to something like this Environment="JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64"
Ensure you didn’t change the ownership for the files by running this command ls -lh in /opt/tomcat/logs directory Just incase the ownership was changed, change it back to tomcat by running the command below:
This message comes from the Linux Standard Base (LSB) init script, which is used to start and stop the service.
common caues;
Port Conflicts: The Tomcat server might be configured to listen on a port that is already in use by another service. You can check which ports are in use on your system with the netstat command.
Misconfigured JAVA_HOME: Tomcat server needs correct JAVA_HOME environment variable to function properly. You can check if JAVA_HOME is set by running the following command:
echo $JAVA_HOME
And also permissions
Then to get more insight,
You can check the tomcat service log files, located in /var/log/tomcat* or /usr/local/tomcat/logs (path may vary depending on how tomcat was installed) for more information about the error, it will provide more detail about the problem.
In addition to checking the log files and troubleshooting the possible causes I mentioned above, you may also want to check the service’s init script (usually located in /etc/init.d/tomcat or /etc/systemd/system/tomcat.service ) and configuration files ( usually located in /etc/tomcat/ or /usr/local/tomcat/conf) for any issues that might prevent the service from starting.