- priority: 5 --> 9
Hi Team,
i am developing one application it uses "platonos plugin engine".
server
|
------ plugin 1
------ plugin 2
basically server accepts plugins, install them and manage their lifecycle.
plugin register their service classes to server
Note : service classes loaded by plugin class loader
server loaded by system default class loader
when any request come to server server identifies proper plugin class from registry and call method of plugin
before calling it is doing
Thread.currentThread().setContextClassLoader(pluginClassLoader);
this works better for non custom objects. like standard JRE objects (Int, Long,String etc..)
now my one plugin have one custom serialized object
which visible in plugin class loader.
but when it used Java ObjectInputStream to deserialize
protected Class<?> resolveClass(ObjectStreamClass desc)
throws IOException, ClassNotFoundException
{
....
return Class.forName(name, false, latestUserDefinedLoader());
....
}
latestUserDefinedLoader() return server class loader (IN DEBUG VIEW)
which causes class not found exception.
actually it should use plugin class loader
but this same scenario works properly in tomcat with different classloaders.
i am surprised how tomcat able to change behaviour of latestUserDefinedLoader()
do i need to change classloader for some security or permission or something else pls help ???
awaiting for ur reply !!!!