cast across classloader?

Not possible. Class identity consists of the fully qualified name and the class loader.

Casting an object to a class with the same name loaded by different classloaders is no different than trying to cast a String to Integer, because those classes really could be completely different despite having the same name.

Leave a Comment