Search code examples
javaclassloader

how to share objects between different classloaders?


I need different classloaders to be able to unload classes. But i need to share objects between them (actually i am getting ClassCastException). So what are the solutions to deal with this?. Thanks


Solution

  • Objects from different classloaders can interact with each other through interfaces and classes loaded by a common classloader.