As part of the resolution to getting the Windows REFS and MOCA services running again, application teams should always validate the LESDIR/data/env.bat (Windows = %LESDIR% | Unix/Linux \ $LESDIR) JAVA mappings. It is recommended the path be full qualified or validated in a Windows Explorer to ensure the path mapping is still a valid path after a JAVA update occurs. In the env.bat file you must validate the JAVA_HOME and JAVA_JRE environment variables map to a valid version of JAVA installed on the machine. Make any necessary changes and save the file and attempt to restart one or both of the Windows WMS Services.
Variables that need to be changed in registry.ini:
[ENVIRONMENT] > JREDIR
[ENVIRONMENT] > JAVA_HOME
[ENVIRONMENT] > PATH
[JAVA] > vm
Variables that need to be changed in env.bat:
set JREDIR
set JAVA_HOME
set PATH
If you continue to receive the Windows service error described in this article, the next best course of action is to verify the MOCA log in the LESDIR/log directory for the instance that is having trouble. This log is commonly titled moca.instance_name.date of file.log (e.g.: moca.gdapp.2018-02-16.log). In this log you will see if the JAVA JVM is able to start. Typically the JVM.dll is invoked. If you see errors in here with the JVM.dll, validate the JAVA version that the JVM is trying to use.
[2018-02-16 06:45:48] [info] [14840] Commons Daemon procrun (1.0.15.0 64-bit) started
[2018-02-16 06:45:48] [info] [14840] Running 'moca.gdapp' Service...
[2018-02-16 06:45:48] [info] [22532] Starting service...
[2018-02-16 06:45:48] [error] [22532] Failed creating java C:\Program Files\Java\jre1.8.0_131\bin\server\jvm.dll
[2018-02-16 06:45:48] [error] [22532] The system cannot find the path specified.
[2018-02-16 06:45:48] [error] [22532] ServiceStart returned 1
[2018-02-16 06:45:48] [error] [22532] The system cannot find the path specified.
[2018-02-16 06:45:48] [info] [14840] Run service finished.
[2018-02-16 06:45:48] [info] [14840] Commons Daemon procrun finished
In the above example an older version of JAVA is still trying to be used by the windows service. Unfortunately the JAVA automatic update process automatically removes the older version of JAVA after the upgrade is applied. In the example above a Windows system registry still contains the old JAVA mappings. We'll need to change those. First we'll focus on the MOCA change...
In the Registry use the menu option to Find a specific registry key. You'll be looking specifically for the MOCA instance name (in our example it is 'gdapp'). Looking for your instance, you'll likely identify the Jvm reference for MOCA under:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\moca.gdapp\Parameters\Java]
Take note of the version of the JVM that JAVA is using... in the example below , we have already corrected the mapping for the JVM. In an export of the registry the entry looks like this:
"Jvm"="C:\\Program Files\\Java\\jre1.8.0_151\\bin\\server\\jvm.dll"
[please note, that the screenshots were not captured for this article due to restrictions of the editor tool, therefore exports of the registry keys were taken in saved to text files. All examples for the Registry editor are reflected as the text key word parameter values]
The exmaple above reflects the corrected version for the JVM. It should be noted that no spaces can exist in these registry values! You must change the JVM value if it references an old/removed version of JAVA. Our previous version the JVM parameter referenced were...C:\Program Files\Java\jre1.8.0_65\bin\server\jvm.dll
Save your registry change and move on to REFS. In the Registry use the menu option to Find a specific registry key. You'll be looking specifically for the REFS instance name (in our example it is 'gdweb'). Looking for your instance, you'll likely identify the AppEnvironmentExtra reference for REFS under:
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\REFS (gdweb)\Parameters]
Take note of the version of the JVM that JAVA is using... in the example below , we have already corrected the mapping for the JVM...
JAVA_HOME=C:\PROGRA~1\Java\JRE1.8.0_151
Please note the system may convert it to something like these (in this example): JAVA_HOME=C:\PROGRA~1\Java\JRE18~2.0_1
[please note, that the screenshots were not captured for this article due to restrictions of the editor tool, therefore exports of the registry keys were taken in saved to text files. All examples for the Registry editor are reflected as the text key word parameter values]
The example above reflects the corrected version for the JVM. It should be noted that no spaces can exist in these registry values! You must change the JVM value if it references an old/removed version of JAVA. Our previous version the JVM parameter referenced were...JAVA_HOME=C:\PROGRA~1\Java\JRE18~1.0_6
Save your registry change and exit the Windows system Registry Editor.
Attempt to restart the Windows service(s). If they successfully start you are ready to use the environment. If they fail again, verify the registry keys are mapped appropriately.