Why do I get "Warning: Cannot load an object of class 'listener':" when I open figure?
22 views (last 30 days)
Show older comments
MathWorks Support Team
on 6 Jul 2023
Answered: MathWorks Support Team
on 20 Jul 2023
Why do I get the warning below when I open a MATLAB figure (.fig) ?
Warning: Cannot load an object of class 'listener':
No matching constructor signature found.
> In matlab.graphics.internal.figfile.FigFile/read (line 31)
In matlab.graphics.internal.figfile.FigFile
In loadFigure (line 31)
In openfig>localOpenFigure (line 75)
In openfig (line 40)
In open (line 139)
In uiopen (line 122)
Warning: During load:
An invalid default object has been detected while loading a heterogeneous array of class
event.listener. An empty array of class event.listener will be returned.
> In matlab.graphics.internal.figfile.FigFile/read (line 31)
In matlab.graphics.internal.figfile.FigFile
In loadFigure (line 31)
In openfig>localOpenFigure (line 75)
In openfig (line 40)
In open (line 139)
In uiopen (line 122)
Warning: Cannot load an object of class 'proplistener':
No matching constructor signature found.
> In matlab.graphics.internal.figfile.FigFile/read (line 31)
In matlab.graphics.internal.figfile.FigFile
In loadFigure (line 31)
In openfig>localOpenFigure (line 75)
In openfig (line 40)
In open (line 139)
In uiopen (line 122)
Warning: During load:
An invalid default object has been detected while loading a heterogeneous array of class
event.proplistener. An empty array of class event.proplistener will be returned.
> In matlab.graphics.internal.figfile.FigFile/read (line 31)
In matlab.graphics.internal.figfile.FigFile
In loadFigure (line 31)
In openfig>localOpenFigure (line 75)
In openfig (line 40)
In open (line 139)
In uiopen (line 122)
Accepted Answer
MathWorks Support Team
on 6 Jul 2023
This answer was flagged by Ralph N
The cause of the warning message is that while loading the object from the MAT-File, MATLAB was not able to attach the listener back to the object. This is caused by a bug from MATLAB Releases early than R2016a.
This bug has been fixed since R2016b. The listener was saved to transient property on a figure rather than inside appdata. However, figures generated from an earlier release could still trigger these warning messages in all MATLAB Releases. But these warning messages should not affect the normal use of the loaded figure.
0 Comments
More Answers (0)
See Also
Categories
Find more on Images, Figures, Axes, Equations, MATLAB Code, and MATLAB Variables in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!