Exist: "Failed to start service"

Created on 30 Jun 2018  Â·  19Comments  Â·  Source: eXist-db/exist

Hi, can you help me?

What is the problem

I extract the application .jar (with command java -jar) and then I start the app from command line with the command -jar start.jar. When I try to start the service from application a window appears with the words "Failed to start service". I try also to starts to windows service but the program says that the file does not exist.
Here there are the screenshots of the installation procedure with the related problem:
https://drive.google.com/open?id=18jB94FQ0F0pHDnhoCexe6udtvTmN2Jza

What did you expect

Start the server and open the dashboard.

Context information

  • eXist-db version "eXist-db-setup-4.2.1" and "eXist-db-setup-4.1.0"
  • Java version: Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
  • Windows 10 pro
  • 64 bit
windows

All 19 comments

I think after installation there should be a little eXist-db icon in the system tray. Do you see anything?

Yes, there is.. Have you seen the screenshots?

I notice two problems in your screenshots.
1) windows seems to think that an exist service is already installed (maybe from an older version?). according to the docs you need to run
tools/yajsw/bin/installService.bat with admin privileges for the service to become available, does that work for you?

2) It cannot find its data-directory in C:\eXist-db\webapp\WEB-INF\data is there something there when you look at it in the explorer? Do you have the right permissions to write to that directory?

In a workshop last week, where we had all users install eXist 4.2.1 (and Java 8) on their laptops beforehand, the two Windows 10 users both were unable to start eXist via service / system tray or java -jar start.jar (which also started the service); eXist was installed at C:\eXist and not in Program Files. While we didn't have time to fully troubleshoot, we did get eXist started via bin\startup.bat. We also had a similar problem with an Ubuntu 17.10 user. While Mac users didn't have this problem, I wonder if the service wrapper is at fault for Windows 10 and Ubuntu?

I also could not get eXist 4.3.0 to run under Windows 10.
However, what I found is that the file path in the Service was wrong, it started with /Library. It is possible to change that to the correct path via the command line (assuming eXist is installed in c:\exist-db):

sc config eXist-db binPath= "java.exe -classpath C:\eXist-db\tools\yajsw\wrapper.jar -Xrs -Dwrapper.service=true -Dwrapper.working.dir=C:\eXist-db -Dwrapper.config=C:\eXist-db\tools\yajsw\conf\wrapper.conf -Dwrapper.additional.1x=-Xrs -Djna_tmpdir=c:\eXist-db\tools\yajsw\tmp org.rzo.yajsw.boot.WrapperServiceBooter"

The space after binPath= is important. It might be necessary to specify the full path to the Java bin.


If eXist does not start and also java -jar start.jar does not work, this might be a problem with Java – make sure you have a current Java version and that it is 64 bit.

As Joe already wrote, the issue is probably caused by the problem described in #2005

Just wanted to chime in;
I ran into the same issue on Windows and was able to fix this by escaping the path to wrapper.java.command in the EXIST_DIR/tools/yajsw/conf/wrapper.conf file.

For example, this would work:

#********************************************************************
# Java Executable Properties
#********************************************************************
# Java Application
wrapper.java.command=C:\\Program Files\\Java\\jre1.8.0_181\\bin\\java.exe

interestingly the space in Program Files is not escaped...

see #1417 #1621

I recently went through an install on WIn 10 Enterprise without problems, is this still an issue with exist 5.0.0?

In eXist-db 5.0.0 the service management is completely different and rewritten. So this would likely only be relevant to 4.x.x.

Same problem - Windows 10 Pro; "could not start service; exit code 4". eXist-db service in the Services console shows it as stopped and not-restart-able - shows service specific code error 1. Java Admin Client runs fine. Double clicking on the eXist-db Database desktop icon results in "eXist-db already installed as service!", with the rest of the message cut off.

@RabbitJackTrade which version of eXist-db are you using?

@adamretter Most recent stable version - 5.0.0.

I suspect that this is a specific issue regards Windows Service.

Looking back at my own earlier comment, could this be a problem when upgrading on windows? The successful install i mentioned was a clean install. Could it be that we need to remove the exist-4 service or something along these lines?

P.S: i can't test this as i don't have a win system to play around with.

FWIW, mine was also a clean install. Not only that, when I encountered this problem I uninstalled both eXist-db and Java, restarted and reinstalled both. Still the same issue.

I am going to close this as it is unclear if this is still an issue. Much work has been done on improving the Windows service capabilities in eXist-db 5.0.0.

If this is still a problem in eXist-db 5.3.0 which will be released soon, please re-open/comment with details.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

opax picture opax  Â·  3Comments

adamretter picture adamretter  Â·  4Comments

joewiz picture joewiz  Â·  3Comments

cmil picture cmil  Â·  3Comments

adamretter picture adamretter  Â·  4Comments