Wednesday, January 31, 2018

Quick Debugger Tip, where was that class loaded from.

Often when it is Friday afternoon and you want to go home early you come across an intractable class loading issue. You might grep your application server home, examine all the domains you can find. (I was looking at weblogic) And still you cannot find out where the class is coming from.

Now you can use the debugger in your IDE of choice to get hold of the class loader; but in this case the parent class loader had upwards of 300 jar files in it so this was going to be a pain to be sure. So it occurred there was a quicker way, just use the standard method getResource to ask the class loader which jar the file was coming from:

Turned out someone has installed SOA on this particular weblogic install, and all the relevant files were in a different directory root: this is why my original grep didn't find the jar files.

No comments: