The reason one is Exception and the other is Error is,
When a system can't find a class that needs to be loaded then its an exceptional situation which the caller of the program (client) might want to handle in some way ...
BUT when a system can't find a class which was there originally on compilation time (otherwise we would get symbol not resolved error on compile time for class B in our example above), THEN its an Error. Hence it throws NoClassDefFoundError.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Differnce between NoClassDefFoundError and ClassNotFoundException