The MATLAB Runtime instance could not be initialized

30 views (last 30 days)
hello
we are incorporating matlab .Net dlls in our application, and i'm getting exceptions at run time:
The MATLAB Runtime instance could not be initialized
Error initializing MATLAB Runtime: Some error has occurred in the file: b:\matlab\standalone\mclbase\app_state.cpp, at line: 106.
The error message is:
Failed to open mcljmiutils library
at MathWorks.MATLAB.NET.Utility.MWMCR..ctor(String componentName, String componentPath, Boolean isLibrary)
--- End of inner exception stack trace ---
at MathWorks.MATLAB.NET.Utility.MWMCR..ctor(String componentName, String componentPath, Boolean isLibrary)
at SD.Algorithms.MarkerPlacmentCalculation.MarkerPlacmentCalculation..cctor()
--- End of inner exception stack trace ---
at SD.Algorithms.MarkerPlacmentCalculation.MarkerPlacmentCalculation..ctor()
at SD.Framework.Services.MarkerPlacement.MarkerPlacementAlgoWrapper..ctor() in C:\dev2\iLogicII\Private Branches\Win10\Source\iLogic2\Services\MarkerPlacement\MarkerPlacementWrapper64\MarkerPlacementAlgoWrapper.cs:line 39
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at SD.Framework.Infrastructure.ServiceLocator.Factory`1.DoCreate(Object Params, String name, String assemblyName) in C:\dev2\iLogicII\Private Branches\Win10\Source\iLogic2\Framework\SD.Framework\Infrastructure\ServiceLocator\ServiceLocator.cs:line 224
at SD.Framework.Infrastructure.ServiceLocator.Factory`1.Create() in C:\dev2\iLogicII\Private Branches\Win10\Source\iLogic2\Framework\SD.Framework\Infrastructure\ServiceLocator\ServiceLocator.cs:line 105
at SD.Logic.ENB.Procedure.MarkerPlacementLogic..ctor() in C:\dev2\iLogicII\Private Branches\Win10\Source\iLogic2\Applications\ProcedureApp\Logic\SD.Logic.ENB.Procedure\MarkerPlacementLogic.cs:line 80
a few facts about the machine i'm having problem with:
  1. the matlab dlls are compiled with Matlab 2016b (9.1)
  2. the machine is installed with MCR2016b(9.1) and MCR2013b(8.2)
  3. the MCR2016b is before MCR2013b in the PATH
  4. the application uses .Net 4.5.2
  5. all the application dlls are loaded via service locator
  6. all of the Dlls are loaded in parallel

Answers (1)

Rushikesh
Rushikesh on 5 Sep 2024
Edited: Rushikesh on 5 Sep 2024
The error you are facing is most likely related with MATLAB Runtime (MCR), specifically related to mcljmiutils library.
In some cases, similar errors have occurred due to MCR not being “Full MCR” or MCR version is not updated. Please refer to the following workarounds which might help you to resolve the issue
1. In case of MATLAB R2016b release, after downloading respective MCR version, make sure to update it. You can do so by clicking on the “update” button given in the row of R2016b in the link below.
2. In MATLAB R2016b, generally MCR installed with it is smaller than Full MCR. MCR Downloaded from above website is Full MCR.
3. If the above listed solutions didn't work, try updating MATLAB, MCR and related tools to 2017a release or above and update the MCR as suggested above.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!