Is there a way to determine which ClassLoader loads a particular class? Or more specifically, where does a particular class come from?
I have a situation where the old db driver class is loaded. I would like to find the file from which the old driver was loaded.
My initial approach is to set the debugging point of the ClassLoader.loadClass (..) method and stop vm as soon as the class loads, to see which class loader loads. Unfortunately, the loadClass method is called so often that it is difficult to stop where the class is loaded. I will try to set a breakpoint filter. However, there is another problem: because of the ClassLoader architecture, loadClass is called even if ClassLoader is not responsible for loading.
There must be a better way to achieve what I want. Do you have an idea or suggestion where to look for a solution?
source share