As part of DXA 1.7 I'm setting up the SDL Web Context Service.

Sadly the service won't start, I get this from the Services snap-in:

enter image description here

Checking the Event Viewer, I can see the staggeringly inconclusive message:

The SDL Web Context Service service terminated with the following service-specific error: The system cannot open the file.

I ran Process Monitor to try and see if any error appeared when the procrun.exe started and couldn't see any clear problem, but what I did see was some additional logging written to C:\Windows\System32\LogFiles\Apache\commons-daemon.2017-03-21.log.

When I open this, I can see:

[2017-03-21 10:04:05] [info]  [19484] Commons Daemon procrun ( 64-bit) started
[2017-03-21 10:04:05] [info]  [19484] Running 'SDLWebContextService' Service...
[2017-03-21 10:04:05] [info]  [43920] Starting service...
[2017-03-21 10:04:05] [error] [ 9688] CreateJavaVM Failed
[2017-03-21 10:04:05] [error] [ 9688] The system could not find the environment option that was entered.
[2017-03-21 10:04:05] [error] [43920] Failed to start Java
[2017-03-21 10:04:05] [error] [43920] ServiceStart returned 4
[2017-03-21 10:04:05] [info]  [19484] Run service finished.
[2017-03-21 10:04:05] [info]  [19484] Commons Daemon procrun finished

Anyone know what environment variable is required?

I have a correct JAVA_HOME set up:

C:\Program Files\Java\jre1.8.0_121

And as this is a single server setup, a TRIDION_HOME:

C:\Program Files (x86)\SDL Web\


At Pete's suggestion, I ran start.ps1:

enter image description here

Everything appeared to run OK? I can see log files written and everything. If I close the script and try the service again, same error.

Something specific to the procrun.exe perhaps?

  • 2
    Have you tried running the service in the console to see if there are more clues? (i.e. run start.ps1 instead) Commented Mar 21, 2017 at 10:22
  • Maybe try uninstalling and reinstalling the service? It's possible that some of the parameters that were specified when you first installed it are no longer valid. Commented Mar 21, 2017 at 10:49
  • I think Java environment variables needs to be corrected. JAVA_HOME should be like C:\Program Files\Java\jdk.8.0_121 and JRE_HOME should be like C:\Program Files\Java\jre1.8.0_121 or C:\Program Files\Java\jdk.8.0_121\jre. Depends on the installation of java. Is there any port conflict are you getting? Which port are you using for this service?
    – SumitK
    Commented Mar 21, 2017 at 12:05
  • The default 8087. The java path is correct for this server and as I say, I get no errors when running from start.ps1 - so I think the service is running. Is there away to disable authentication so I test and be sure?
    – Neil
    Commented Mar 21, 2017 at 12:11

2 Answers 2


One of the jvmoptions that are recomended for installing the service as a standalone microservice, when an HSQLDB is used for the device database, is:


but seems that this option is not a jvmoption.

I modified the installService script and put that option as a server StartParams option instead, and all seems to start and work ok with the context service.

$repository = "--repository.server=true" 
$arguments += "++StartParams=" + $repository

Another problem I had the first time I included the jvmoptions was to change the TEMPDIR string with a real path for the temporal files, that may cause a problem of Input/Output type


  • No the exact answer, but I had installed the device database as a file-system based database NOT as HSQLDB. So I had to remove the repository.server=true (which was there by default) in the installService.ps1
    – Neil
    Commented Mar 22, 2017 at 9:01

Seems to be a filesystem security issue: if the Context Service runs as Windows Service, it typically runs as the SYSTEM account, whereas it runs as your user account if you run it on the PowerShell console,

For such issues, Process Monitor (procmon.exe) can provide a lot of clarity.

  • I'd already mentioned I'd used Process Monitor in my question.
    – Neil
    Commented Mar 22, 2017 at 8:12
  • I'm sorry, I missed that part. Commented Mar 22, 2017 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.