Error on imwrite after several iterations of a loop.
2 ビュー (過去 30 日間)
古いコメントを表示
I'm receiving these errors on a piece of code that has worked perfectly fine before. It seems to be originating from some subcommands of imwrite.
log4j:WARN No appenders could be found for logger (loci.formats.ClassList).
log4j:WARN Please initialize the log4j system properly.
The loop runs through several images before throwing this error. Why is it throwing this error only on some images? Is there a property of the images that I can change? Everything I've read seems to indicate that this is some kind of reporting system in certain matlab toolboxes, but I don't even know what's calling reporter, so the other solutions don't seem to be helpful.
2 件のコメント
Walter Roberson
2023 年 4 月 10 日
https://www.mathworks.com/matlabcentral/answers/20354-report-generation-toolbox-gives-warnings-and-no-figures-in-r2011b#answer_82397
in particular the Java memory part
回答 (1 件)
Sugandhi
2023 年 5 月 12 日
Hi Pattie Mathieu,
I understand that you are getting an error regarding “log4j” only on some images. It seems to be originating from some subcommands of "imwrite”.
The error message you are seeing is related to the log4j logging system and not directly related to the images being processed. It is indicating that the logging configuration has not been properly specified for the "loci.formats.ClassList" logger.
This error occurs when log4j fails to find an appender, which is a component responsible for handling the logging output. It's possible that this error only occurs with some images because the code may be hitting a different code path that triggers logging output in some cases and not in others.
To resolve this error, you need to properly configure the log4j logging system. This can be done by creating a log4j.properties file and placing it in your project's classpath. The file should contain log4j configuration properties that define appenders and loggers.
Here's an example log4j.properties file that defines a console appender and a root logger that has debug level logging:
log4j.rootLogger=DEBUG, consoleAppender
log4j.appender.consoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.consoleAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.consoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
You can customize this configuration to suit your needs and place it in your project's classpath. This should properly initialize the log4j system and prevent the error from occurring.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!