ClassCastException because of classloaders?

只谈情不闲聊 提交于 2019-11-27 08:57:38

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.

Filipe Fedalto

That's exactly the case. You can't use casting between classes loaded by different classloaders.

This question, "Cast across classloader" may make things clearer...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!