Search code examples
javatomcatweblogicclassloader

Weblogic dynamic class loading


Does someone found a way to use (for development) a "dynamic" class loader for weblogic 8 or 10 ?

I am looking for an hot, jar / classes, classloader reload mecanism.

For tomcat 4 -> 6, i use since several years an old, but very convenient, Dev class loader :

http://www.eclipsetotale.com/tomcatPlugin.html

So, i am looking for an analog way for weblogic ?

Regards


Solution

  • Weblogic's hot deploy is just that- it redeploy's the app, which consists of dumping the existing classloader, all the classes it has loaded and their instances. So, in essense its not reloading the class, it is instantiating a new classloader and that is loading the new class.

    Weblogic 10.3 onwards they have a fastswap feature which reloads a class on the the fly. I am fuzzy on the details, but I believe it loads classes with a level of indirection that enables it to load a modified class and make the classloader point to the new one.

    Ofcourse, you could use the old way of doing thigs: use the debugger and change the byte code for methods when the server is in debug mode and you are connected to it via your eclipse. The last thing is good for small changes, but if you want to add new classes, modify class structure- it wont work. This will preserve the sessions and object state.