There has been more than one comment in the errata for Modular Java that mention a strange NoClassDefFoundError
with regard to org.compass.core.util.reflection.ReflectionMethod
.
I started to address these concerns on the errata page, but decided to talk about it here because (1) the comment button on the errata page seems to be missing right now and (2) I want to address it once instead of once for each errata item. Once I get the comment button back, I'll point the readers here for more info.
As it turns out, when I run my local instance of Dude, Where's My JAR?, I get that very same exception. I never really noticed it before, but sure enough it's there. Why didn't I notice it? Didn't I test this? Am I, as one reviewer incorrectly suggested, asking my readers to do my QA for my book?
Absolutely not! Believe me when I say that I walked through the instructions for Dude, Where's My JAR? no less than a half-dozen times before the book went to print. My editor will attest to the fact that I've put in far more testing time on this book's examples than for any of my previous books. I am confident that the examples in the book were working before they were published. Had they not been, I would've corrected them before they ended up in your hands. Furthermore, I know of several people who have also successfully worked through the examples.
Are they perfect? Probably not. I'd be shocked if I were ever able to, on my own, produce a flawless example. But I'm certain that I didn't just toss the example over the wall for the readers to sort through.
But the question still remains: How did I not notice the NoClassDefFoundError
? Well, even though I witnessed that error when I ran my own instance of Dude, Where's My JAR?, the application still works. The spider crawls the repository, deposits its findings in the index, and the web lets me search for JAR files. The example works in spite of the error. The error itself happens very early in the startup of the application, so unless I'm paying very close attention, it scrolls off the screen unnoticed. Since the application works, I never felt compelled to review the log files for the error.
But this doesn't mean that the case is closed. I do not think such an exception should go unanswered. I will try to figure out why the error happens (I suspect it has something to do with the way OSGi class loaders work) and once I find a way to keep it from appearing, I'll let everyone know how to fix it. In the meantime, feel free to ignore that error--as far as I can tell it is innocuous.