Remedy - Email Engine - Error:"Could not find the service start class" starting the Email Engine as a Service but works when using the emailstart.bat batch file (Windows)

Version 5
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    Remedy AR System Server


    COMPONENT:

    AR System


    APPLIES TO:

    AR Sysystem Email Engine v.7.6.x, v.8.x, v.9.x on Windows.



    PROBLEM:

    The Email Engine service starts and then stops immediately with no errors in the email log. However, running it from the emailstart.bat works as expected.
    Nothing is written to the email logs. 

    The Windows Event Viewer Application log shows:
    ...........
     "Could not find the service start class"
    ...........


     


    CAUSE:

    Invalid directory path in the AR System Email Engine Service Registry key for "-Djava.class.path"


    SOLUTION:

     

    In cases such as this, when there are no error messages in the stderr.log, stdout.log (7.6.x - 8.x) or the email.log (9.x and higher) the next log to check is the Windows Event Viewer.
    In Event Viewer go to Windows Logs > Application log:

              User-added image

    Be sure to check both tabs of each message you see for the AR System Email Engine for any helpful information.
    There is a General tab and a Details tab. In most cases, the Details tab will be most helpful but you need to expand the sections to see the all of the information that is there.

              User-added image

    When the Service starts but then immediately stops, in a majority of cases it is because it is unable to load the jvm or find the class path.
    The Details tab in the Event Viewer Application log may or may not show this but in most cases it does give some hint as to the problem.

    For example:
    ....................
    "Could not load jvm.dll" 
    or
    "Could not load Java virtual machine" or
    "Unable to find the file specified" or
    "Could not find the service start class"
    ....................


    In cases where the Email Engine works from the batch file (emailstart.bat) but not from the Services Console, we have to look to compare the differences between the configuration data in the:
    emailstart.bat
    vs
    Email Engine Service registry key.
    ( HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BMC Remedy Email Engine - <server name\Parameters)

    In the case of the last example message above, "Could not find the service start class" we know that it starts from the emailstart.bat. and we need to verify the path for the java in the batch file is the same as the value in the Registry Key.

    emailstart.bat example:
    .....................
    echo off
    rem =====================================================================
    rem This batch file assumes that it is being run from the install directory
    rem and that java is in the the PATH.
    rem =====================================================================
    rem -s servername -u username -p application password

    set LIBVER=91_build002
    set OSGI_BUNDLE_VER=9.1.03
    set
    JavaPath=C:\Program Files\Java\jre1.8.0_111\bin
    set JAVA_OPTS="-Xms256m -Xmx1024m -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false -Demail.console.output=true"

    "%JavaPath%\java" "%JAVA_OPTS%" -cp emaildaemon.jar;.;log4j-1.2.14.jar;arapi%LIBVER%.jar;arutil%LIBVER%.jar;activation.jar;
    mail.jar;imap.jar;smtp.jar;pop3.jar;armapi%LIBVER%.jar;com.bmc.arsys.companion.client-%OSGI_BUNDLE_VER%-SNAPSHOT.jar;
    com.bmc.arsys.companion.remote-%OSGI_BUNDLE_VER%-SNAPSHOT.jar;com.bmc.arsys.messaging.client-%OSGI_BUNDLE_VER%-SNAPSHOT.jar;activemq-all-5.10.0.jar com.bmc.arsys.emaildaemon.EmailDaemon %*
    .....................


    The java related configuration information in the batch file gives the JavaPath, Java options and then the various .jar files.
    The emailstart.bat file is run from the AR Email directory.

    Checking the example below from the EE Registry Key there are the various java configuration parameters:

              User-added image


    The java configuration keys on the right hand side are the one which need to be checked:
         JVM Library
         -Djava.library.path
         -Djava.class.path 


    When it comes to the 8dot3 naming conventions, make sure these paths are correct.
    This can be verified by copying the path out and pasting it in to Windows Explorer or another more concise method is to use a command line with the dir commands and the ad/ x/ options.
    Example to verify the PROGRA~1 and BMCSOF~1 the following commands can be used from the command line:
         dir pro*.* /ad /x
         
    dir bmc*.* /ad  /x


    - Open a command line to the C:\ directory. 
    - Type dir pro*.* /ad  /x
    - Check the results for the various PROGRA~* folders. It is most likely going to see several or at least a couple in most cases. 

    Next change directories to C:\Program Files:
         C:\>cd Program Files
         C:\Program Files> dir bmc*.* /ad  /x


    Check the results for the various BMCSOF~* folders.
    There may be only one but this is what we need to confirm. 

    In the example screen command line screen shot, see the results from a test system:

              Email Engine Command line example

    In this example, the registry keys are correctly pointing to the right PROGRA~1 and BMCSOF~1 directories. 

    However, in some cases, BMCSOF~1 may not exist. It has been observed in some occasions the Registry Key pointing to BMCSOF~! for the -Djava.library.path and -Djava.class.path.

    Using the command line options as shown above , the 8dot3 directory can be found if the directory BMCSOF~1 exists.
    It may be the case that it does not exist and a different directory is present such BMCSOF~2 so the all of the Parameters for the Registry Key pointing to BMCSOF~! would need to be edited to BMCSOF~2

    This Registry Key Parameter that causes:
    .........................
    "Could not find the service start class"
    .........................

    error in the Event Viewer Application Log as observed was due to the -Djava.class.path value.

    If this is the case:
    - Edit the -Djava.class.path value to use the correct BMCSOF~ which will allow the Email Engine to start.
    - Note that this is a long key and it is easiest to double click on the JVM Option Number then copy out the Value data to a text editor that allows you to replace all.
    - Then paste the updated data string into the open String Editor and click OK.
    Example of a -Djava.class.path:
    ..................
    -Djava.class.path=C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\emaildaemon.jar;C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\log4j-1.2.14.jar;
    C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\arapi91_build002.jar;C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\arutil91_build002.jar;
    C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\activation.jar;C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\mail.jar;C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\imap.jar;
    C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\smtp.jar;C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\pop3.jar;
    C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\com.bmc.arsys.companion.client-9.1.03-SNAPSHOT.jar;
    C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\com.bmc.arsys.companion.remote-9.1.03-SNAPSHOT.jar;
    C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\com.bmc.arsys.messaging.client-9.1.03-SNAPSHOT.jar;
    C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\activemq-all-5.10.0.jar;C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail\armapi91_build002.jar;
    C:\PROGRA~1\BMCSOF~1\ARSystem\AREmail;.
    ..................


    - Make sure that all other keys are updated to point to the correct directory
    e.g:
    Current Directory
    -Djava.library.path=

    ***NOTE: Editing the Registry Manually can be risky and you do so at your own risk. Always take precautions to back it up first. 

     


    Article Number:

    000143110


    Article Type:

    Solutions to a Product Problem



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles