Forum Discussion

FICO's avatar
FICO
Community Manager
2 years ago

Project compiles in the UI, but web service call fails with "java.rmi.RemoteException: Failure compiling an agent for rule source"

As the title says, everything looks good in the UI. However the WS call returns the error below. This is a service that has been deployed for a long time, the changes are not significant but did include a new jarfile with a few new classes. I stripped out the specific project and server identifiers in the snippet below.

{"error":{"code":"DM-REST-Service-Internal-Server-Error","timestamp":"Tue, 6 Feb 2024 14:10:33 GMT","desc":"Service 'RmaDynamicWeb'. Server 'RmaDynamicWeb' on host 'dm-component-xxx-yyy-zzz'.\nError getting Serialized Project Loader\nRemoteException occurred in server thread; nested exception is: \n\tjava.rmi.RemoteException: Failure compiling an agent for rule source XXXXXXXX: Compilation failed for the project 'XXXXXXXX'.; nested exception is: \n\tCompilation failed for the project 'XXXXXXXXXX'."}}

3 Replies

  • FICO's avatar
    FICO
    Community Manager

    Please contact FICO product support via the support portal at https://ficoitservices.service-now.com/support so a support engineer can troubleshoot this with you through a web session.

  • FICO's avatar
    FICO
    Community Manager

    "Error getting Serialized Project Loader": Could be wrong about the following; however, based on *ancient* history, the error may have nothing to do with the actual project contents (ie, it may well compile correctly in the UI). Sooo ... wtf???

    Key here is the reference to the "Serialized Project Loader". For those who have ever delved into the actual contents of the Server Configuration File (ie, .server) OR, in cases when the Deployment Manager is used (ie, well, just about all the "£$% time) in the DManager Configuration File (ie, .dmanager): the Project Loader section specifies *where* the rule project should be loaded from, and in what format.

    *Serialized* Project Loader implies the project should load from an .adb file (aka "pre-compiled" or "serialized" rule project). The options specified in this section of the configuration file should then identify *where* said .adb file may be found (ie, should have the path reference to the file specified in that section of the file).

    Note, however, that the path is created based upon the .adb file location at the time the configuration file is generated. If the file is moved, or more commonly, if the Rule Server and/or Deployment Manager are executing in a different environment from the one used at the time the configuration file was generated, then said path reference will no longer be correct. In which case, the Project Loader cannot locate said .adb file, in which case, the project will fail to load, thence generating the error message reported for this incident.

    Now ... that's the analysis of a *very* old Blaze user (who, coincidentally used to teach the Rule Server class ... and authored the original version of said class, in which students were deliberately encouraged to examine the contents of the configuration files - in the *controlled context* of a classroom), and represents the most common circumstance under which said error would commonly occur (particularly if, well, the .adb file already contains the *compiled* version of the project). However, it's certainly not the only one which might cause said error.

    Also check the Java version which was used to compile the project vs. the one used in the runtime environment where the Rule Server is executing. The serialized version of the project does depend upon the Java version used at time of project compilation. A mismatch between the two may cause the project to fail to load/compile correctly at runtime.

    Finally, (come to think of it),. the reference to a "RemoteException" may indicate a failure of communication between the Rule Server and Deployment Manager. If the "Serialized Rule Project Loader" section in question is found in the .server file, but NOT in the .dmanager file (as would always be the case when the DManager is used, as the DManager would then be responsible for both loading and compiling the rule project, and would always pass the project to the Rule Server in serialized format. The "Remote Exception" might indicate a failure to correctly establish communication between the Rule Server and DManager instances. Check the RMI configuration parameters in both .server and .dmanager files. These again would have been set automatically at the time the configuration files were generated. If there's been any changes to that setup after the files were created, then it's possible a problem might arise there. (Although, in that case, I'd have expected the log to have reported an exception in the attempt to establish communication between Rule Server and DManager beforehand).

    Hope the above helps.

  • FICO's avatar
    FICO
    Community Manager

    Oh, yeah, - addendum to prior answer: should have thought to mention, also make certain that any external supporting resources required by the rule project (ie. JAR or XSD files used to define the project's Business Object Model) are also available and in the correct location as referenced in the configuration files (.server and .dmanager), and that the CLASSPATH on the runtime environment is specified correctly. Failure to load the correct JAVA classes used in the BOM will cause failure to compile the rule project.