Do You Really Get Classloaders?
“Do You Really Get Classloaders” represents a culmination of the research and content that Jevgeni Kabanov and his team at ZeroTurnaround (especially the developers working on JRebel, which cleverly loopholes classloaders in order to reload all sorts of code changes without restarting anything) have uncovered in the last 4 years.
In this tour of the Java classloading mechanism, we examine things both from the JVM and developer point-of-view. We will look at typical problems related to classloading and how to solve them. NoClassDefFoundError, LinkageError and many others are symptoms of specific things going wrong that you can usually find and fix. For each problem, we’ll go through an example with a corresponding solution.
We’ll also take a look at how and why classloaders leak & how can that be remedied as well as how to reload a Java class using a dynamic classloader. To get there we’ll see how objects, classes and classloaders are tied to each other and the process required to make changes. We begin with a bird’s eye view of the problem, explain the reloading process, and then proceed to a specific example to illustrate typical problems and solutions.