I'm struggling to make a SpringBootApp to run as a service at the moment. The biggest issue is that Devops doesn't allow us to make changes on the Ansible scripts that deploys the artifact and creates the service (sample shown below).
[Unit] Description=A Spring Boot application After=syslog.target [Service] User=rating-gateway ExecStart=/opt/rating-gateway/rating-gateway-0.0.1-SNAPSHOT.jar SuccessExitStatus=143 Restart=always RestartSec=5
Technically, If I were to add java -jar on the ExecStart it will run correctly, but as we cannot edit the Ansible scripts I need to find a workaround. I've read a few guides where the service does not use java -jar instruction, but not sure what would be missing for this to run correctly.
I've added java to the PATH as I thought that would help me. But it didn't.
Any other ideas? to workaround this issue?
Thanks in advanced.
PS. I'm a Dev, but got root access to the server, so any help is pretty welcome.
(edit extra info) When I don't have java -jar on the ExecStart command. I get the following error in the /var/log/messages
Mar 30 08:44:44 systemd: rating-gateway.service: Failed at step EXEC spawning /opt/rating-gateway/rating-gateway-0.0.1-SNAPSHOT.jar: Exec format error
But I've already confirmed the architecture of both platform where jar is built and server that is deployed. Both are x84_64