The first and most common one is that multiple threads use ThreadLocal
The second type is that different class loaders cause no value to be obtained. The essential reason is that different class loaders cause multiple ThreadLocal objects
The objects loaded by the two accumulators reference the same static variable ThreadLocal. In fact, ThreadLocal is not the same value, so the expected value cannot be obtained even in one thread.
Like dependency injection, if you create an object yourself, and then manually inject a dependency created by a container, assuming this dependency is created by a custom class adder, this may cause this situation.