wood burning stoves*
The moose likes IDEs, Version Control and other tools and the fly likes How does JavaRebel work with classloaders? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How does JavaRebel work with classloaders?" Watch "How does JavaRebel work with classloaders?" New topic
Author

How does JavaRebel work with classloaders?

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10067
    
163

Let's consider we have J2EE application deployed in an application server. Application servers provide a way to configure classloaders for your application. This way, the classes within your application will be loaded by your application classloader. Now let's assume one of the classes in this application changes.

How does JavaRebel load this changed class? More specifically, which classloader will JavaRebel use to load this class?


[My Blog] [JavaRanch Journal]
Jevgeni Kabanov
Java Rebel Support
Ranch Hand

Joined: Jul 22, 2008
Posts: 32
JavaRebel neither introduces new classloader nor changes the classloader hierarchy in any other way. The classes will be loaded in the same classloader as usual (including changed ones).
[ August 12, 2008: Message edited by: Jevgeni Kabanov ]

<a href="http://www.zeroturnaround.com/jrebel/" target="_blank" rel="nofollow">JRebel</a> reloads Java code on-the-fly (<a href="http://www.zeroturnaround.com/jrebel-demonstration-screencast/" target="_blank" rel="nofollow">see demo screencast</a>)
Toomas Römer
JavaRebel Support
Greenhorn

Joined: Jul 07, 2008
Posts: 17
Hi Jaikiran,

Depends on your application's classloader. If there is a lot of magic you might need to make minor changes but most custom classloaders work out-of-the-box.

Basically JavaRebel integrates with all the classloaders in the application server applying our generic integration (if not specified differently by our integration). This will happen automatically if your own classloader is a derivative of URLClassLoader.

Our integration is released as open-source. For example to see what exactly we do for the generic integration see the generic installation source files.


JRebel reloads Java code on-the-fly
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10067
    
163

Thanks Jevgeni and Toomas

Updating class files on the fly without redeploying the entire application is one of the most frequently asked question in the application server forums. I will see how the trial version of this tool works out with JBoss.

Our integration is released as open-source. For example to see what exactly we do for the generic integration see the generic installation source files.


Great!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How does JavaRebel work with classloaders?