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.