A 'ClassNotFoundException' is thrown when the reported class is not found by the 'ClassLoader' in the 'CLASSPATH'. It could also mean that the class in question is trying to be loaded from another class which was loaded in a parent classloader. Hence the class from the child classloader is not visible.
Consider if 'NoClassDefFoundError' occurs then it would be something like this:
But this does not mean that the 'TestClass' class is not in the CLASSPATH. It means that the class 'TestClass' was found by the 'ClassLoader'. However, when one tries to load the class, it runs into an error while reading the class definition. This typically happens when the class in question has static blocks or members which uses a Class that's not found by the ClassLoader. So, in order to find the culprit, view the source of the class in question (TestClass in this case) and look for code using static blocks or static members.