JRebel and Tapestry working together
I've recently started trialling JRebel at work. JRebel is a piece of software that hot-swaps your code so that changes made in your IDE are reflected in your application server without requiring a restart.
The benefits of this idea are fairly obvious. I no longer have to wait 1 - 2 minutes for JBoss to restart each time I correct a spelling mistake etc. The time saved by not restarting probably make the product worth the $US149 licensing fee.
Then there is the significant reduction in context switching. I no longer make a code change, restart JBoss, read the New York Times for 2 minutes, forget what I changed, then try to test it. Instead I make the change and test it straight away. This can only mean fewer bugs (and perhaps a less-informed developer but people assume that nerds live under rocks anyway, so that's ok).
Once JRebel was installed my JBoss startup time went from 1:40 to 3:45, but I figured that would be OK because I would only have to do that once a day. JRebel did most of what I expected it to, and I was happily coding away in my new no-context-switching life until I changed a Tapestry binding and the code wasn't hot-swapped even though I had the Tapestry plug-in enabled.
This forced a JBoss restart (or several, to be honest) and I had lost all the benefit of JRebel. Later I discovered that I needed to combine a few things to get JRebel to work nicely with Tapestry. Here's what I had to do:
- Enable the Tapestry 4 plugin (-Drebel.tapestry4_plugin=true)
- Enable Tapestry reset service (-Dorg.apache.tapestry.enable-reset-service=true)
Now whenever I change a Tapestry file, I simply invoke the Tapestry reset service (http://localhost:8080/myApp/app?service=reset) and then refresh the page. Voila! The code gets hot-swapped.
I think this technique works because invoking Tapestry's reset service clears its cache and forces it to reload the classes which have been updated by JRebel.
February 27th, 2010 - 11:07
What Tapestry version are you talking about?
February 27th, 2010 - 13:35
Tapestry 4.1.6
March 1st, 2010 - 12:34
Just to clarify — JRebel costs $149.. not $160. For individuals’ who want a personal license, it’s $59.
(I have to do this, I’m a detail-freak)
March 1st, 2010 - 12:55
My apologies – I was thinking in CAD. I’ve corrected the post.
March 1st, 2010 - 13:14
You might want to try JRebel 3.0 preview and see if you startup time would go down. We made a lot of performance/startup time improvements in the last milestone.
March 24th, 2010 - 09:33
i very adore your own posting type, very helpful,
don’t give up as well as keep writing since it simply just that is worth to follow it,
looking forward to see far more of your writing, stunning day!
March 31st, 2010 - 19:20
I really like when people are expressing their opinion and thought. So I like the way you are writing