While going through and migrating our projects to log4j 2.2, there are several apps and 3rd party libraries that we use that depend on log4j 1.2.
Whilst the log4j-1.2-api library pretty much works flawlessly for us, I ran into an issue today with the opensaml1 library which breaks when it tries to call NDC.pop().
In log4j 1.2, NDC.pop() would check to see if the stack was empty and if it was, returned an empty string but with the log4j-1.2-api library, the DefaultThreadContextStack.pop() ends up throwing a NoSuchElementException which causes everything to fall over for us.
Given the library is meant to provide backwards compatibility, shouldn't the behaviour also be the same? At present, upgrading the OpenSAML library isn't an option, frustratingly.
] Unhandled exception: - java.util.NoSuchElementException: The ThreadContext stack is empty
at org.opensaml.SAMLException.getInstance(Unknown Source)
at org.opensaml.SAMLResponse.fromDOM(Unknown Source)
at org.opensaml.SAMLResponse.<init>(Unknown Source)