Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLF4M busted under R2022a or R2021b - log4j upgrade #7

Open
HenningBraess opened this issue May 16, 2022 · 6 comments
Open

SLF4M busted under R2022a or R2021b - log4j upgrade #7

HenningBraess opened this issue May 16, 2022 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@HenningBraess
Copy link

Hi,

I installed SLF4m on Matlab R2022a (Windows 10). When I called the attached helloWorld program I got the following exception code:


Error using logger.Log4jConfigurator.configureBasicConsoleLogging
Invalid default value for property 'initializer' in class 'logger.Logger':
Java exception occurred:
java.util.NoSuchElementException

at org.apache.log4j.helpers.NullEnumeration.nextElement(NullEnumeration.java:45)

Error in logger.internal.Slf4mInitializer.initSLF4M (line 59)
logger.Log4jConfigurator.configureBasicConsoleLogging()

Error in logger.internal.Slf4mInitializer (line 12)
logger.internal.Slf4mInitializer.initSLF4M;

Error in loggerCallImpl (line 42)
loggerObj = logger.Logger.getLogger(callerId);

Error in logger.debug (line 14)
loggerCallImpl('debug', msg, varargin);

Error in helloWorld (line 6)
logger.debug('Got empty x input; defaulted to %f', x);


Is there anything that I need but did not install?

Any help is appreciated.

@HenningBraess
Copy link
Author

It appears to be an issue with R2022a. Using it with R2021a is no problem.

@maben-mw
Copy link

maben-mw commented Jun 3, 2022

FYI: MATLAB releases prior to R2021b Update 2, used to include slf4j with a binding to log4j 1.2 and then also the log4j 1.2 implementation itself.

As of release R2021b Update 2, MATLAB still includes slf4j with still a binding to log4j 1.2 but now then the log4j 1.x bridge and as actual log4j implementation: log4j 2.

The issue could very well be related to this change.

@apjanke
Copy link
Member

apjanke commented Jun 15, 2022

Hi! Sorry I didn't notice this bug report earlier; my Watch settings for this repo must be off.

@maben-mw 's analysis is correct: The Matlab R2021b log4j 2.x major version bump and use of the log4j 1.x bridge is busticating SLF4M. I'm currently working on a fix (and talking with MathWorks Tech Support), but it's nontrivial. I hope to have this fixed in a couple weeks. I do not know a workaround. Sorry for the inconvenience!

@apjanke apjanke self-assigned this Jun 15, 2022
@apjanke apjanke added the bug Something isn't working label Jun 15, 2022
@apjanke apjanke added this to the 1.3.0 milestone Jun 15, 2022
@apjanke
Copy link
Member

apjanke commented Jun 15, 2022

BTW, @maben-mw :

MATLAB releases prior to R2021b Update 2

Was it really Update 2, and not the original R2021b release? I can't believe MathWorks finally got around to upgrading a Java library, and they shipped it in a Update. Shakes head.

@apjanke
Copy link
Member

apjanke commented Jun 15, 2022

BTW, here's a list of all the third-party Java libraries that some versions of Matlab are bundled with, if anyone's curious about the details here:

https://docs.google.com/spreadsheets/d/1qL9NVwVhiA_BqX16Gr9-mMKqQ0MEOGxClGA0ms7mji0/edit?usp=sharing

@apjanke
Copy link
Member

apjanke commented Jun 15, 2022

MathWorks Technical Support Case #05490191 if anyone would like to hear MathWorks's side of this issue.

@apjanke apjanke modified the milestones: 1.3.0, 1.4.0 Jun 16, 2022
@apjanke apjanke changed the title Cannot get SLF4m to run Cannot get SLF4M to run under R2022a Jun 16, 2022
@apjanke apjanke changed the title Cannot get SLF4M to run under R2022a Cannot get SLF4M to run under R2022a or R2021b - log4j upgrade Jul 2, 2022
@apjanke apjanke changed the title Cannot get SLF4M to run under R2022a or R2021b - log4j upgrade SLF4M busted under R2022a or R2021b - log4j upgrade Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants