Running jar as a service problem

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












after a few days of pondering around google I give up.



Running Tika-Server with command line works fine and Tika-Server starts responding on http://localhost:9998:



java -jar tika-server-2.0.0-SNAPSHOT.jar


Following this guide (with appropriate changes to scripts, paths and jar names ofc) Tika-Server is not responding on http://localhost:9998. I have used option with logging from this guide (at the bottom) and output to log file is the same as is when Tika-Server is run with command line.



Service does not show up with command



systemctl | grep running


but it shows up with command



systemctl list-unit-files | grep enabled


as enabled.



I have also tried to run java service via init.d path, but it didnt work.



What am I missing?










share|improve this question























  • What does systemctl status the-name-of-your-service print? e.g. systemctl status Tika-Server if you set up your service as /etc/systemd/system/Tika-Server.service
    – Stuart Caie
    Mar 22 at 9:21











  • It returns alot, not sure which part you are interested in. This is interesting part: ● Tika-Server.service - Tika Server Java Service Loaded: loaded (/etc/systemd/system/Tika-Server.service; enabled; vendor preset: enabled) Active: inactive (dead) since Thu 2018-03-22 08:33:28 UTC; 50min ago Process: 3993 ExecStop=/usr/local/bin/Tika-Server.sh stop (code=exited, status=0/SUCCESS) Process: 3991 ExecStart=/usr/local/bin/Tika-Server.sh start (code=exited, status=0/SUCCESS) Main PID: 2797 (code=exited, status=143)
    – SubjectX
    Mar 22 at 9:25










  • Hmm, after running sudo systemctl start Tika-Server.service command again, it appears it started working.. Could there be a timeout problem or something?
    – SubjectX
    Mar 22 at 9:27










  • I think this indicates the server itself failed/exited at some point after being started. Logs would help. Instead of having Type=forking and ExecStart, ExecStop, ExecReload point to a script that starts/stops/restarts the java jar, try putting the java jar command directly in the .service file, e.g. Type=simple then ExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar and remove ExecStop and ExecReload -- systemd (systemctl status ...) then will also show you logs (anything printed by the server on stdout/stderr), which the intermediate script is redirecting to /dev/null
    – Stuart Caie
    Mar 22 at 9:48











  • Awesome, will try this for sure!!
    – SubjectX
    Mar 22 at 10:54














up vote
0
down vote

favorite












after a few days of pondering around google I give up.



Running Tika-Server with command line works fine and Tika-Server starts responding on http://localhost:9998:



java -jar tika-server-2.0.0-SNAPSHOT.jar


Following this guide (with appropriate changes to scripts, paths and jar names ofc) Tika-Server is not responding on http://localhost:9998. I have used option with logging from this guide (at the bottom) and output to log file is the same as is when Tika-Server is run with command line.



Service does not show up with command



systemctl | grep running


but it shows up with command



systemctl list-unit-files | grep enabled


as enabled.



I have also tried to run java service via init.d path, but it didnt work.



What am I missing?










share|improve this question























  • What does systemctl status the-name-of-your-service print? e.g. systemctl status Tika-Server if you set up your service as /etc/systemd/system/Tika-Server.service
    – Stuart Caie
    Mar 22 at 9:21











  • It returns alot, not sure which part you are interested in. This is interesting part: ● Tika-Server.service - Tika Server Java Service Loaded: loaded (/etc/systemd/system/Tika-Server.service; enabled; vendor preset: enabled) Active: inactive (dead) since Thu 2018-03-22 08:33:28 UTC; 50min ago Process: 3993 ExecStop=/usr/local/bin/Tika-Server.sh stop (code=exited, status=0/SUCCESS) Process: 3991 ExecStart=/usr/local/bin/Tika-Server.sh start (code=exited, status=0/SUCCESS) Main PID: 2797 (code=exited, status=143)
    – SubjectX
    Mar 22 at 9:25










  • Hmm, after running sudo systemctl start Tika-Server.service command again, it appears it started working.. Could there be a timeout problem or something?
    – SubjectX
    Mar 22 at 9:27










  • I think this indicates the server itself failed/exited at some point after being started. Logs would help. Instead of having Type=forking and ExecStart, ExecStop, ExecReload point to a script that starts/stops/restarts the java jar, try putting the java jar command directly in the .service file, e.g. Type=simple then ExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar and remove ExecStop and ExecReload -- systemd (systemctl status ...) then will also show you logs (anything printed by the server on stdout/stderr), which the intermediate script is redirecting to /dev/null
    – Stuart Caie
    Mar 22 at 9:48











  • Awesome, will try this for sure!!
    – SubjectX
    Mar 22 at 10:54












up vote
0
down vote

favorite









up vote
0
down vote

favorite











after a few days of pondering around google I give up.



Running Tika-Server with command line works fine and Tika-Server starts responding on http://localhost:9998:



java -jar tika-server-2.0.0-SNAPSHOT.jar


Following this guide (with appropriate changes to scripts, paths and jar names ofc) Tika-Server is not responding on http://localhost:9998. I have used option with logging from this guide (at the bottom) and output to log file is the same as is when Tika-Server is run with command line.



Service does not show up with command



systemctl | grep running


but it shows up with command



systemctl list-unit-files | grep enabled


as enabled.



I have also tried to run java service via init.d path, but it didnt work.



What am I missing?










share|improve this question















after a few days of pondering around google I give up.



Running Tika-Server with command line works fine and Tika-Server starts responding on http://localhost:9998:



java -jar tika-server-2.0.0-SNAPSHOT.jar


Following this guide (with appropriate changes to scripts, paths and jar names ofc) Tika-Server is not responding on http://localhost:9998. I have used option with logging from this guide (at the bottom) and output to log file is the same as is when Tika-Server is run with command line.



Service does not show up with command



systemctl | grep running


but it shows up with command



systemctl list-unit-files | grep enabled


as enabled.



I have also tried to run java service via init.d path, but it didnt work.



What am I missing?







16.04 command-line java services jar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 9:18

























asked Mar 22 at 9:01









SubjectX

1085




1085











  • What does systemctl status the-name-of-your-service print? e.g. systemctl status Tika-Server if you set up your service as /etc/systemd/system/Tika-Server.service
    – Stuart Caie
    Mar 22 at 9:21











  • It returns alot, not sure which part you are interested in. This is interesting part: ● Tika-Server.service - Tika Server Java Service Loaded: loaded (/etc/systemd/system/Tika-Server.service; enabled; vendor preset: enabled) Active: inactive (dead) since Thu 2018-03-22 08:33:28 UTC; 50min ago Process: 3993 ExecStop=/usr/local/bin/Tika-Server.sh stop (code=exited, status=0/SUCCESS) Process: 3991 ExecStart=/usr/local/bin/Tika-Server.sh start (code=exited, status=0/SUCCESS) Main PID: 2797 (code=exited, status=143)
    – SubjectX
    Mar 22 at 9:25










  • Hmm, after running sudo systemctl start Tika-Server.service command again, it appears it started working.. Could there be a timeout problem or something?
    – SubjectX
    Mar 22 at 9:27










  • I think this indicates the server itself failed/exited at some point after being started. Logs would help. Instead of having Type=forking and ExecStart, ExecStop, ExecReload point to a script that starts/stops/restarts the java jar, try putting the java jar command directly in the .service file, e.g. Type=simple then ExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar and remove ExecStop and ExecReload -- systemd (systemctl status ...) then will also show you logs (anything printed by the server on stdout/stderr), which the intermediate script is redirecting to /dev/null
    – Stuart Caie
    Mar 22 at 9:48











  • Awesome, will try this for sure!!
    – SubjectX
    Mar 22 at 10:54
















  • What does systemctl status the-name-of-your-service print? e.g. systemctl status Tika-Server if you set up your service as /etc/systemd/system/Tika-Server.service
    – Stuart Caie
    Mar 22 at 9:21











  • It returns alot, not sure which part you are interested in. This is interesting part: ● Tika-Server.service - Tika Server Java Service Loaded: loaded (/etc/systemd/system/Tika-Server.service; enabled; vendor preset: enabled) Active: inactive (dead) since Thu 2018-03-22 08:33:28 UTC; 50min ago Process: 3993 ExecStop=/usr/local/bin/Tika-Server.sh stop (code=exited, status=0/SUCCESS) Process: 3991 ExecStart=/usr/local/bin/Tika-Server.sh start (code=exited, status=0/SUCCESS) Main PID: 2797 (code=exited, status=143)
    – SubjectX
    Mar 22 at 9:25










  • Hmm, after running sudo systemctl start Tika-Server.service command again, it appears it started working.. Could there be a timeout problem or something?
    – SubjectX
    Mar 22 at 9:27










  • I think this indicates the server itself failed/exited at some point after being started. Logs would help. Instead of having Type=forking and ExecStart, ExecStop, ExecReload point to a script that starts/stops/restarts the java jar, try putting the java jar command directly in the .service file, e.g. Type=simple then ExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar and remove ExecStop and ExecReload -- systemd (systemctl status ...) then will also show you logs (anything printed by the server on stdout/stderr), which the intermediate script is redirecting to /dev/null
    – Stuart Caie
    Mar 22 at 9:48











  • Awesome, will try this for sure!!
    – SubjectX
    Mar 22 at 10:54















What does systemctl status the-name-of-your-service print? e.g. systemctl status Tika-Server if you set up your service as /etc/systemd/system/Tika-Server.service
– Stuart Caie
Mar 22 at 9:21





What does systemctl status the-name-of-your-service print? e.g. systemctl status Tika-Server if you set up your service as /etc/systemd/system/Tika-Server.service
– Stuart Caie
Mar 22 at 9:21













It returns alot, not sure which part you are interested in. This is interesting part: ● Tika-Server.service - Tika Server Java Service Loaded: loaded (/etc/systemd/system/Tika-Server.service; enabled; vendor preset: enabled) Active: inactive (dead) since Thu 2018-03-22 08:33:28 UTC; 50min ago Process: 3993 ExecStop=/usr/local/bin/Tika-Server.sh stop (code=exited, status=0/SUCCESS) Process: 3991 ExecStart=/usr/local/bin/Tika-Server.sh start (code=exited, status=0/SUCCESS) Main PID: 2797 (code=exited, status=143)
– SubjectX
Mar 22 at 9:25




It returns alot, not sure which part you are interested in. This is interesting part: ● Tika-Server.service - Tika Server Java Service Loaded: loaded (/etc/systemd/system/Tika-Server.service; enabled; vendor preset: enabled) Active: inactive (dead) since Thu 2018-03-22 08:33:28 UTC; 50min ago Process: 3993 ExecStop=/usr/local/bin/Tika-Server.sh stop (code=exited, status=0/SUCCESS) Process: 3991 ExecStart=/usr/local/bin/Tika-Server.sh start (code=exited, status=0/SUCCESS) Main PID: 2797 (code=exited, status=143)
– SubjectX
Mar 22 at 9:25












Hmm, after running sudo systemctl start Tika-Server.service command again, it appears it started working.. Could there be a timeout problem or something?
– SubjectX
Mar 22 at 9:27




Hmm, after running sudo systemctl start Tika-Server.service command again, it appears it started working.. Could there be a timeout problem or something?
– SubjectX
Mar 22 at 9:27












I think this indicates the server itself failed/exited at some point after being started. Logs would help. Instead of having Type=forking and ExecStart, ExecStop, ExecReload point to a script that starts/stops/restarts the java jar, try putting the java jar command directly in the .service file, e.g. Type=simple then ExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar and remove ExecStop and ExecReload -- systemd (systemctl status ...) then will also show you logs (anything printed by the server on stdout/stderr), which the intermediate script is redirecting to /dev/null
– Stuart Caie
Mar 22 at 9:48





I think this indicates the server itself failed/exited at some point after being started. Logs would help. Instead of having Type=forking and ExecStart, ExecStop, ExecReload point to a script that starts/stops/restarts the java jar, try putting the java jar command directly in the .service file, e.g. Type=simple then ExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar and remove ExecStop and ExecReload -- systemd (systemctl status ...) then will also show you logs (anything printed by the server on stdout/stderr), which the intermediate script is redirecting to /dev/null
– Stuart Caie
Mar 22 at 9:48













Awesome, will try this for sure!!
– SubjectX
Mar 22 at 10:54




Awesome, will try this for sure!!
– SubjectX
Mar 22 at 10:54















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1018180%2frunning-jar-as-a-service-problem%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1018180%2frunning-jar-as-a-service-problem%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491