Review: JRebel with Domino OSGi development

Last year I finally figured out how to use JRebel with Domino, and I posted a how-to video. I thought I would do a quick follow up to say how it’s going.

It is going great! I can’t imagine giving back my JRebel license. I have gone entire days without restarting my http server.

If you are only developing xpages from within an NSF, and don’t do any OSGi plugin development, then you really don’t have much need for JRebel. But if you are involved in any OSGi Library development and in particular UI Component development, then I would recommended fighting tooth and nail to get yourself a JRebel licence.

I have done a bunch of UIComponent development in the last few months and I would have to say, that it would have probably just given up on it all if I didn’t have JRebel, as there is lots of small changes that would be so painful if it required me to restart all the time, especially when it is just a typo or an incorrectly sized array!

A couple of points

Static instances and inner classes

There are some things that JRebel can’t reload on the fly, thankfully it is only occasionally that you come across this, JRebel will say something like “Couldn’t load <blah blah> because something about static things” ┬áin the domino console.

Java Security Settings

When trying to do certain things JRebel can causes a AccessControlException error due to the java security settings. You can get around this by putting your **development** server into ‘AllPermissions’ mode.

e.g. putting this entry in a java.pol file in the domino/jvm/lib/security/ directory

This is not a perfect situation as it probably won’t mirror the settings on your Production server, and it might mask another AccessControlException that could be triggered by some other part of the code you are running.

Theoretically it should be possible to write a Java Security entry that specifically covers JRebel but on both occassions that I tried this I failed so I decided just to put it the dev server in ‘all permissions’ mode and then turn this off when I want to test anything special that could cause AccessControlException’s e.g. reflection / use of 3rd party libraries.

Video Correction / Clarification

In the how-to video, I mention that I don’t think the REBEL.base config is that important. However it is important.
When you start your Domino Server, the Rebel Base directory will be different, depending on whether you start your server as a regular application or Start it as a service.

You don’t have to specify the rebel.base location, but if you leave it blank, just know that JRebel will determine this directory based on whatever user account launches the server.

So if you launch as a service, it will use the HOME directory of whatever user is set to launch the service (perhaps Administrator?), or if you start as application, it will use your own HOME directory.

 

You may also like...

2 Responses

  1. Is it really so much better then the normal hot replacement feature from Java? I use the hot replacement feature of Java very often and only very seldom i get the error message the hot code replacement is not possible and i have to restart the application.

    • camerongregor says:

      Hi Ralf, I know that you do a lot of plugin development for the Notes Client and suspect you may be referring to using Hot replacement in that situation. I have found no major problems with hot replacement for Notes/Designer Client Plugins and would not suggest using JRebel instead of that.
      Howver when trying to use Hot Code Replacement during remote debugging with XPages plugins for Domino Server, I have had several problems. The worst problem is frequent server crashes (not just Http server but entire server) which end up causing even more time lost than restarting http. In addition to that I did find that I encountered the situation where ‘Hot Code Replacement can’t create a new field etc.’ much more during XPages plugin development than I did during Notes Client Plugin development, and I would definitely say JRebel is much more capable in this respect with the only real cause for restarting is the above mentioned issues related to static fields / instances.

Leave a Reply

Your email address will not be published. Required fields are marked *