ℹ️ Since log4j:log4j
isn't maintained any longer, this repository is archived to shut up Dependabot.
A small test setup to demonstrate the issues described here: http://stackoverflow.com/questions/15543521/mixed-usage-of-log4j-and-commons-logging-causes-a-class-loading-deadlock
The three tests
TestMixedLoggerInstantiation
,
TestLoadingByClassForName
&
TestLoadingMixed
try to reconstruct said scenario.
The first close to real life, the other two by reducing it to the essence.
A deadlock isn't produced often, and depending on the used hardware, may never occur.
Therefore, the test
TestClassLoadingDeadlock
is an even more simplified scenario reduced to the problem of a classloading deadlock.
This proved to be very likely in producing a deadlock (at least on my hardware).
Note that Log4j 2 no longer sports the problematic class hierarchy, and thus shouldn't produce the discussed behavior.