I am trying to run executable on the command prompt after building it with MATLAB mcc, and I receive this error, is there any way to fix it?

44 views (last 30 days)
Warning: A Java exception occurred trying to load the gmat/gmatConstants class:
Java exception occurred:
java.lang.UnsatisfiedLinkError: gmat.gmatJNI.INTEGER_TYPE_get()I
at gmat.gmatJNI.INTEGER_TYPE_get(Native Method)
at gmat.gmatConstants.<clinit>(gmatConstants.java:20)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.mathworks.jmi.OpaqueJavaInterface.findClass(OpaqueJavaInterface.java:137)
Warning: "gmat.jar" is already specified on static java path.
> In javaclasspath>local_validate_dynamic_path (line 290)
In javaclasspath>local_javapath (line 187)
In javaclasspath (line 124)
In javaaddpath (line 71)
In load_gmat2 (line 49)
In Freqcull_Propagation (line 39)
Warning: "gmat.jar" is already specified on static java path.
> In javaclasspath>local_validate_dynamic_path (line 290)
In javaclasspath>local_javapath (line 187)
In javaclasspath (line 124)
In javaaddpath (line 71)
In load_gmat2 (line 49)
In Freqcull_Propagation (line 39)
Warning: "station.jar" is already specified on static java path.
> In javaclasspath>local_validate_dynamic_path (line 290)
In javaclasspath>local_javapath (line 187)
In javaclasspath (line 124)
In javaaddpath (line 71)
In load_gmat2 (line 49)
In Freqcull_Propagation (line 39)
Warning: "gmat.jar" is already specified on static java path.
> In javaclasspath>local_validate_dynamic_path (line 290)
In javaclasspath>local_javapath (line 187)
In javaclasspath (line 124)
In javaaddpath (line 71)
In load_gmat2 (line 49)
In Freqcull_Propagation (line 39)
Warning: "station.jar" is already specified on static java path.
> In javaclasspath>local_validate_dynamic_path (line 290)
In javaclasspath>local_javapath (line 187)
In javaclasspath (line 124)
In javaaddpath (line 71)
In load_gmat2 (line 49)
In Freqcull_Propagation (line 39)
Warning: "navigation.jar" is already specified on static java path.
> In javaclasspath>local_validate_dynamic_path (line 290)
In javaclasspath>local_javapath (line 187)
In javaclasspath (line 124)
In javaaddpath (line 71)
In load_gmat2 (line 49)
In Freqcull_Propagation (line 39)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe559c5195, pid=19880, tid=0x00000000000065d0
#
# JRE version: Java(TM) SE Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.202-b08 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C 0x00007ffe559c5195
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\skhalil\AppData\Local\Temp\hs_error_pid19880.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Assertion failed: Fatal Java Exception. See this file for details: C:\Users\skhalil\AppData\Local\Temp\hs_error_pid19880.log
Function: void __cdecl `anonymous-namespace'::mwJavaAbort(void), file B:\matlab\src\jmi\jmi\javainit.cpp, line 1458
--------------------------------------------------------------------------------
Assertion detected at 2024-09-18 10:12:05 -0400
--------------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : true
Graphics Driver : Uninitialized hardware
Graphics card 1 : Advanced Micro Devices, Inc. ( 0x1002 ) AMD Radeon HD 5450 Version 15.201.1151.1008 (2015-11-4)
Interpreter 0 : Executing request: 636F72652F4D636C4D766D4D6372496E7374616E63652E637070
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : win64
MATLAB Entitlement ID : Unknown
MATLAB Root : C:\Program Files\MATLAB\R2023a
MATLAB Version : 9.14.0.2337262 (R2023a) Update 5
OpenGL : hardware
Operating System : Microsoft Windows 10 Pro
Process ID : 19880
Processor ID : x86 Family 6 Model 30 Stepping 5, GenuineIntel
Session Key : e794fc96-8b18-464f-a7d8-130744301b4c
Window System : Version 10.0 (Build 19045)
Fault Count: 1
Additional Log Files:
Java Crash Report : C:\Users\skhalil\AppData\Local\Temp\hs_error_pid19880.log
Assertion in void __cdecl `anonymous-namespace'::mwJavaAbort(void) at B:\matlab\src\jmi\jmi\javainit.cpp line 1458:
Fatal Java Exception. See this file for details: C:\Users\skhalil\AppData\Local\Temp\hs_error_pid19880.log
Current Thread: 'MCR 0 interpreter thread' id 26064
Register State (captured):
RAX = 00007ffef8c8bd58 RBX = 00007ffef8c8bd58
RCX = 000000fa2a1f9f30 RDX = 0000000000000000
RSP = 000000fa2a1f9e70 RBP = 00000000000005b2
RSI = 000002d2306a58e0 RDI = 00007ffef8c8bd58
R8 = 0000000000000006 R9 = 000000fa2a1f9de8
R10 = 0000000000000017 R11 = 000000fa2a1f9c68
R12 = 000000fa2a1fa570 R13 = 0000000000000000
R14 = 00007ffed850e288 R15 = 00007ffef8c7bc88
RIP = 00007ffef8b8164a EFL = 00000202
CS = 0033 FS = 0053 GS = 002b
Stack Trace (captured):
[ 0] 0x00007ffef8b7ac63 C:\Program Files\MATLAB\R2023a\bin\win64\libmwfl.dll+00044131
[ 1] 0x00007ffef8b79238 C:\Program Files\MATLAB\R2023a\bin\win64\libmwfl.dll+00037432
[ 2] 0x00007ffef8b7de4d C:\Program Files\MATLAB\R2023a\bin\win64\libmwfl.dll+00056909
[ 3] 0x00007ffef8b7c851 C:\Program Files\MATLAB\R2023a\bin\win64\libmwfl.dll+00051281
[ 4] 0x00007ffef8b80ebb C:\Program Files\MATLAB\R2023a\bin\win64\libmwfl.dll+00069307
[ 5] 0x00007ffed8476d11 C:\Program Files\MATLAB\R2023a\bin\win64\jmi.dll+00683281
[ 6] 0x00000000772a9ead C:\Program Files\MATLAB\R2023a\sys\java\jre\win64\jre\bin\server\jvm.dll+02727597
[ 7] 0x000000007729208b C:\Program Files\MATLAB\R2023a\sys\java\jre\win64\jre\bin\server\jvm.dll+02629771
[ 8] 0x00000000772aac26 C:\Program Files\MATLAB\R2023a\sys\java\jre\win64\jre\bin\server\jvm.dll+02731046
[ 9] 0x00000000772af52d C:\Program Files\MATLAB\R2023a\sys\java\jre\win64\jre\bin\server\jvm.dll+02749741
[ 10] 0x0000000077345d98 C:\Program Files\MATLAB\R2023a\sys\java\jre\win64\jre\bin\server\jvm.dll+03366296
[ 11] 0x00007fff5c4d292f C:\Windows\SYSTEM32\ntdll.dll+00665903
[ 12] 0x00007fff5c482554 C:\Windows\SYSTEM32\ntdll.dll+00337236
[ 13] 0x00007fff5c4d143e C:\Windows\SYSTEM32\ntdll.dll+00660542
[ 14] 0x00007ffe559c5195 C:\Users\skhalil\AppData\Local\Temp\skhalil\mcrCache9.14\Freqcu0\Freqcull_Pro\Orbital Apps and Files\Orbital Apps\GMAT\bin\libGmatBase.dll+03756437
[ 15] 0x00007ffe559fcec5 C:\Users\skhalil\AppData\Local\Temp\skhalil\mcrCache9.14\Freqcu0\Freqcull_Pro\Orbital Apps and Files\Orbital Apps\GMAT\bin\libGmatBase.dll+03985093
[ 16] 0x00007ffe558f97e6 C:\Users\skhalil\AppData\Local\Temp\skhalil\mcrCache9.14\Freqcu0\Freqcull_Pro\Orbital Apps and Files\Orbital Apps\GMAT\bin\libGmatBase.dll+02922470
[ 17] 0x00007fff20c6ab40 C:\Users\skhalil\AppData\Local\Temp\skhalil\mcrCache9.14\Freqcu0\Freqcull_Pro\Orbital Apps and Files\Orbital Apps\GMAT\bin\gmat_java.dll+00240448
[ 18] 0x000002d20ef077ce <unknown-module>+00000000
** This crash report has been saved to disk as C:\Users\skhalil\AppData\Local\Temp\matlab_crash_dump.19880-1 **
MATLAB is exiting because of fatal error
  3 Comments
Sharif Khalil
Sharif Khalil on 19 Sep 2024
Edited: Sharif Khalil on 19 Sep 2024
Good morning,
Thank you for your question, I would like to clarify more what I am doing so that this might answer this question:
I have a MATLAB script that sets up an environment in another third-party tool that I have to pass some parameters from the the MATLAB script and get some results from that tool. This works perfectly fine when I run it from MATLAB. Now, I am trying to build an executable using the mcc command in MATLAB to run this simulation as a standalone Application. Once I generate this executable and input the parameters to the generated .exe from the command prompt, I receive this error. I have little to no experience with Java, so I cannot understand what is the problem and how to fix it.
I have looked into solutions from MathWorks, chatgpt, etc. This led to some solutions that I have implemented, but did not fix the problem:
1- Adding path for MATLAB and Java runtime in environment variables for windows OS.
2- Also adding the folder path for the third-party tool where the .dll files are (libGmatBase.dll, gmat_java.dll).
3- Applying "Dependancy Walker" on the libGmatBase.dll, and found 4 different .dll files (kernel32.dll, advapi32.dll, msvcp140.dll, vcruntime140.dll) that are having errors (but chatgpt answered that these 4 files would not cause the problem).
4- Installing Visual C++ Redistributable (Already installed).
5- Another solution found is Java incompatability between the one in MATLAB and windows (as far as I understood), did not proceed with this one.
So, I thought of posting it as a question on MathWorks for the hope of finding any solution that could work.
I hope this explanation could answer this question, or if there is any steps that I can follow to find exactly what is required would be much appreciated.
Thanks again!

Sign in to comment.

Answers (1)

Aditi
Aditi about 7 hours ago
It seems that MATLAB exits due to access voilation exception detected by JRE. Access voilation can happen due to a variety of reasons.
I can see you have the crash dump as well as the log file. I would recommend you to contact MathWorks Technical Support(Contact Support - MATLAB & Simulink) with the crash log and dump to resolve the issue.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!