Microflow failed to call ML model - failed to initialize the onnxruntime.dll

0
Hi, I tried to implement an example of ML Kit using the Titanic Survivor prediction model (https://github.com/mendix/mlkit-example-app/tree/main/mlsource/titanic_xgboost). Everything seemed OK, but when I called the ML model this error happened: "java.lang.UnsatisfiedLinkError: D:\MendixApps\TestMLKit-main\deployment\data\tmp\onnxruntime-java12737386488199200666\onnxruntime.dll: A dynamic link library (DLL) initialization routine failed. ..." I tried with several versions of Mendix Studio Pro 10, 11 but no luck.   Search thru the Internet and found some suggestion to reinstall MSVC Distribute files, but the error is still there.   Please give me some hint. Thanks
asked
1 answers
0

1. I used dumpbin.exe (from Microsoft Visual Studio 2022) to identify which MSVC runtime DLL and version were required by onnxruntime.dll:

   dumpbin /headers "D:\MendixApps\TL_v11_Test_UI-main\deployment\data\tmp\onnxruntime-java3040408790582685369\onnxruntime.dll"

   The output shows that onnxruntime.dll was built against MSVCP140.dll version 14.40.

2. Next, I checked the Windows Application Event Log to see whether any runtime errors were reported. I found the following crash entry:

   Faulting application name: javaw.exe, version: 21.0.2.0, time stamp: 0x20b3d83f     Faulting module name: msvcp140.dll, version: 14.36.32532.0, time stamp: 0x04a30cf0     Exception code: 0xc0000005     Fault offset: 0x0000000000012f58     Faulting process id: 0x4680     Faulting application start time: 0x01dc886059ea1702     Faulting application path: C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\bin\javaw.exe     Faulting module path: C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot\bin\msvcp140.dll  

3. From this information, I determined that javaw.exe was loading MSVCP140.dll version 14.36 from the JDK directory, which is older than the required version (≥ 14.40) used to build onnxruntime.dll. This version mismatch caused the access violation crash.

   To resolve the issue, I uninstalled all existing versions of Mendix Studio Pro and then installed the latest version (Mendix Studio Pro 11.6.2). The newer installation includes a compatible MSVC runtime, and after upgrading, the issue was resolved successfully.

answered