Matlab engine: License Checkout Failed

14 vues (au cours des 30 derniers jours)
Jacob Heller
Jacob Heller le 4 Mai 2021
I'm trying to figure out why I'm getting a License Checkout Failed when running Matlab Engine from Java. I have this very simple Matlab script:
function [] = Test()
x = [1 2 3 4 5];
y = [ 4 6 8 5 3];
mdl = fitlm(x,y);
mdl
end
fitlm requires the Statistics_Toolbox. I can run the above script without issues from the Matlab (version 2019b) desktop application. But when I run the same script through the Matlab engine I get
Exception in thread "main" com.mathworks.engine.MatlabExecutionException: Test()
at com.mathworks.engine.FutureResult.get(FutureResult.java:64)
at com.mathworks.engine.MatlabEngine.eval(MatlabEngine.java:349)
at xxxxxxx.main(Test.kt:11)
Caused by: com.mathworks.mvm.exec.MvmRuntimeException: License checkout failed.
License Manager Error 0
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/R2019b/0
Diagnostic Information:
Feature: Statistics_Toolbox
License path: C:\Users\xxxx\AppData\Roaming\MathWorks\MATLAB\R2019b_licenses;C:\Program Files\MATLAB\R2019b\licenses\license.dat;C:\Program Files\MATLAB\R2019b\licenses\network.lic
Licensing error: 0,0.
... 3 more
com.mathworks.mvm.exec.MvmRuntimeException: License checkout failed.
License Manager Error 0
I then tried setting environment variables. I tried
MLM_LICENSE_FILE=2700@matlabls.draper.com
but then I get License Manager Error -39. I tried again, with
MLM_LICENSE_FILE=1711@matlabls.draper.com
(which matches the port in my network.lic file) and I got License Manager Error -59.
Please help! Why am I able to get a license when using the desktop app, but not when using the engine through Java?

Réponses (1)

Walter Roberson
Walter Roberson le 4 Mai 2021
  2 commentaires
Jacob Heller
Jacob Heller le 5 Mai 2021
@Walter Roberson I was able to figure out the literal meaning of these errors, but I still don't understand why I would be getting these issues when using the engine if the desktop app has no issues.
Walter Roberson
Walter Roberson le 6 Mai 2021
For the error -39 I would look in the flexlm logs to see which user and host are being used to access to MATLAB license.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Manage Products dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by