Java errors fill Matlab command window - makes Matlab unusable

I have recently started encountering very odd Matlab behavior. This has occured on version 2022 and now 2024b. The screen fills with what seem to be Java related errors. They go on for pages, but here is a snippet :
...
at com.mathworks.cmlink.util.events.CMAdapterDecorator.getStateForAllKnownFilesRecursively(CMAdapterDecorator.java:159) [util.jar:?]
at com.mathworks.cmlink.util.events.CMAdapterDecorator.getStateForAllKnownFilesRecursively(CMAdapterDecorator.java:159) [util.jar:?]
at com.mathworks.cmlink.management.cache.transaction.CacheTransactionGenerator$1.call(CacheTransactionGenerator.java:50) [management.jar:?]
at com.mathworks.cmlink.management.cache.transaction.CacheTransactionGenerator$1.call(CacheTransactionGenerator.java:45) [management.jar:?]
at com.mathworks.toolbox.shared.computils.threads.WrappingExecutorService$WrappedCallable.call(WrappingExecutorService.java:93) [computils.jar:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
I am running MacOS Sonoma 14.6.1, on Apple Silicon (M1 Macbook Pro) Java version is
version -java
ans =
'Java 11.0.25+9-LTS with Amazon.com Inc. OpenJDK 64-Bit Server VM mixed mode'
which I believe is supported.
I don't know what changed to cause this to happened, and it is somewhat intermittant, but it has made Matlab unusable.

6 Kommentare

Donna Calhoun
Donna Calhoun am 15 Nov. 2024
Bearbeitet: Donna Calhoun am 15 Nov. 2024
I discovered something that does seem to reliably reproduce this error. Whenever I save a file in the Matlab editor, I get the pages of Java/Eclipse errors. Clearing the screen with clc lets me continue until I go to save a file again. Still very annoying.
Thanks for the link to support - I've written them.
I can always reproduce the bug whenever a file in my working directory changes. Even changes to a non-Matlab file can trigger the pages of errors. For example, just doing
(osx) % cat > tmp.dat
will cause the errors to fill my Matlab command window.
It seems that the issue is really that a file has changed in the current working directory. Modifications files in other directories do not trigger this error. In fact, I can now anticipate when to know that the Matlab cursor is unusable, and when to know things will work fine. For example, if I am running a simulation in which a sequence of output files is created, I know that each time the new file is created, I can expect to have the commnd window filled with errors. But then once the file access is done, I can continue plotting, or whatever Matlab task I was doing.
My pleasure!
One item I forgot to mention earlier is to include a link to this thread in your message to MathWorks support. Then you don’t have to repeat everything you wrote here.
Look at the simulation script that causes the problem to see if you can identify the reason. Also, include it in an update to your earlier message to support (as well as a link to this thread if you didn’t already provide it).
I have experience with Windows and am learning Ubuntu Linux, however not MacOS, so I can’t provide any relevant insights in that regard.
Good luck!
.
The issue is that it has nothing to do with the simulation script. I can trigger it from a new Matlab session just by changing directories. So I don't think it has anything to do with a particular script.
I am not sure I can supply a link to the support case, since I believe it is only visible to me.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Donna Calhoun
Donna Calhoun am 20 Nov. 2024

2 Stimmen

The problem was with Git version control. I turned off version control through Matlab Preferences and now the errors go away. I don't use Matlab for version control but rather manage my git repo myself, and so this solution works for me.
No idea why I only started getting these errors now, though (first with 2022, and then with 2024b) since I have been using Matlab with Git projects for 10+ years.

1 Kommentar

Turns out, I had a .gitignore file that in fact was a binary file. No idea how that happened, but after I removed thsi offending file, the error was no longer triggered.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2024b

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by