Sample Header Ad - 728x90

Maven application runs alone but not with systemd

1 vote
1 answer
1055 views
I am trying to run [Sphinx4-Http-server](https://github.com/jitsi/Sphinx4-HTTP-server) on RHEL. If I am in the directory /home/alex/Sphinx4-HTTP-server and run the command /home/alex/apache-maven-3.6.1/bin/mvn exec:java -Dexec.mainClass="org.jitsi.sphinx4http.server.HttpServer", then the server will run. However, when I make a .service file for the program (as shown below), I get a program error (specifically java.lang.ClassNotFoundException: "org.jitsi.sphinx4http.server.HttpServer"). Using this file on Ubuntu works (with adjusted path names), and using similar .service files for other programs on RHEL works. Why would the program run in the shell but not with systemd, even though the systemd file works on another system and similar systemd files work on the same system? How would I go about fixing it? sphinx.service:
[Service]
WorkingDirectory=/home/alex/Sphinx4-HTTP-server
ExecStart=/home/alex/apache-maven-3.6.1/bin/mvn exec:java -Dexec.mainClass="org.jitsi.sphinx4http.server.HttpServer"
Restart=always
StandardOutput=syslog
SyslogIdentifier=sphinx
User=alex

[Install]
WantedBy=multi-user.target
Asked by alexwho314 (27 rep)
May 8, 2019, 10:43 PM
Last activity: Nov 18, 2019, 04:44 PM