ClassCastException because of classloaders?

You cannot cast between class loaders. Class identity is composed of fully qualified name and the class loader. Check class identity crysis here.


Yes, you are correct.

This often happens in OSGi projects, because of bad dependency management.