Salesforce

MOCA and REFS Services fail to start with Error code 1

« Go Back

Information

 
TitleMOCA and REFS Services fail to start with Error code 1
SummaryUser(s) receive Windows service startup error code 1 attempting to start MOCA or REFS.
URL NameMOCA-and-REFS-Services-fail-to-start-with-Error-code-1
Resolution

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.

ProductsWarehouse Management
ModuleREFS, MOCA - Windows Services
Version9.1 and above
Error Message Code
If you are attempting to start MOCA or REFS for versions 9.1 and higher for WMS after a JAVA upgrade you may receive the following error message:

 
Cause
This issue typically occurs when a JAVA update of a version or build is applied and the application paths are not changed in the environment files and Operating System registry keys.  Typically JAVA has the capability to do auto updates that may be unknowing to the application support teams that monitor the application(s). This automatic update process can wreak havoc on the application and the teams supporting those applications because changes are made to the system on unlikely scheduled basis.   When JAVA does get updated, now application files are altered by the JAVA update process.  It is always best to have your IT department turn off the JAVA auto update and/or coordinate with the application team around the time a JAVA update is executed.  In this article we'll discuss the areas users must update and validate to get the Windows Services operational again after a JAVA upgrade is done.

 
Additional Information
Publication StatusPublished

Powered by