As you already noted, Java (or actually the virtual machine that runs your code) loads and resolves classes at the time they are needed. This usually also results in a knock effect for several classes. Obviously, there is a high probability that classes that do not contain woven code are loaded before the Spring classes.
However, the HotSpot Java virtual machine (a typical virtual machine when Oracle Java is installed) can be configured in many ways at startup. One of these options is "- XX: + TraceClassLoading" (note the plus sign, the specified link, unfortunately, documents the minus sign for this option). There is another parameter that tracks loaded classes in referential order.
With this, you can narrow down the problem. Otherwise, sample code might be helpful. Although I'm afraid it will be too big.
source share