Running jar as a service problem
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
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?
16.04 command-line java services jar
add a comment |Â
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?
16.04 command-line java services jar
What doessystemctl 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 havingType=forking
andExecStart
,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
thenExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar
and removeExecStop
andExecReload
-- 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
add a comment |Â
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?
16.04 command-line java services jar
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
16.04 command-line java services jar
edited Mar 22 at 9:18
asked Mar 22 at 9:01
SubjectX
1085
1085
What doessystemctl 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 havingType=forking
andExecStart
,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
thenExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar
and removeExecStop
andExecReload
-- 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
add a comment |Â
What doessystemctl 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 havingType=forking
andExecStart
,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
thenExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar
and removeExecStop
andExecReload
-- 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
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
andExecStart
,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
thenExecStart=/usr/bin/java -jar /path/to/Tika-Server.jar
and removeExecStop
andExecReload
-- 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