Spring bean instantiation errors in application contexts and OSGi
One thing that keeps biting me is when instantiating beans in the application context that have no other references to that class in direct java code—typically I get a class not found error.
The resolution to this of course is to put the package on the classpath so that the class is found when the class loader tries to load it. The easiest way to do this is to include an import-package directive for that package. This puts the package and the classes in it, on the classpath. You can exclude or include individual classes in the import statement if you want finer grain control.