Status 127 can mean a variety of stuff. It’s not really an exit code from which we can fully provide a correct solution/direction.
What I’ll suggest is either checking the logs or your service’s status.
Let’s start with the status first. Try doing the following:
systemctl restart tomcat
systemctl status tomcat
In the status you should be able to see an error somewhere. What does this error say?
If you do not see the error, then turn your attention to Tomcat’s logs. By default logs should be stored in /var/log. Depending on your version the logs can be in
If you are not sure your version, you can type the following command to try and narrow it down:
find /var/log -name 'tomcat*'
find /var/log -name '*tomcat*'
In those logs, you should see the exact reason behind the failure. If you are not sure, you can always provide the error here and we’ll try and help out.