Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Java Q&A
"What Version is Your Java Code?"
Vladimir Roubtsov
Static versus lazy resolution
Vladimir,
Good article (as usual), but I disagree with one thing: You wrote that the "JVM is not allowed to complain about a nonexistent method or class unless it is actually needed at runtime." I think the JVM can complain earlier, even before program execution. The Java Language Specification (JLS), Chapter 12.1.2, mentions one extreme of resolution implementation—static. In this case, the JVM performs recursive resolution (before referenced classes are needed) and complains immediately.
I also have interesting practical experience with it, which proves that the HotSpot JVM is neither static nor the laziest
implementation. I have a Component A that can directly (without reflection) use Component B in concrete circumstances. My
colleagues load-tested Component A, and Component B wasn't on the CLASSPATH. After passing thousands of identical tests (for example, for 10 minutes), suddenly NoClassDefFoundError (with a class from Component B) was thrown. HotSpot probably decided to optimize some classes and load a class from Component
B that wasn't needed. I don't think this goes against the specification.
Vojtech Habarta
Java Q&A
"Cracking Java Byte-Code Encryption"
Vladimir Roubtsov
Avoid exploitation
Vladimir,
You've written an interesting article; however, both deficiencies you have identified can be avoided.
First, JVM modification can be handled by checksumming the JVM (rt.jar) against a known value.
Second, accessing the running JVM via the profiling or debugging interface requires launching the VM with certain options. Implementing a native launcher to load the VM and create the secure classloader prevents this exploit.