Download

Get Loom

Using JRebel

JRebel is a java agent that reloads changes in Java classes on-the-fly, without redeployments or server restarts. The version currently supported is JRebel 2 or greater.

Changes to action classes or to any class that contains validated attributes are detected and applied immediately. To test it:

  • Download JRebel, unzip it and create an environment variable REBEL_HOME, e.g. REBEL_HOME=/usr/local/java/jrebel-2.0.
  • Add "-noverify -javaagent:$REBEL_HOME/jrebel.jar" to your JVM args. If you are using a project created using scaffolding, you should already have two "rebel tomcat" and "rebel jetty" eclipse launch configurations

Next time you start the server JRebel should display something like this at the beginning of your log:

##########################################################
# ZeroTurnaround JRebel 2.0                              #
# ...                                                    #
##########################################################

Any modification to Action or JPA classes will be detected and applied on the next browser request.

JavaRebel: Reloading class 'org.loom.demo.model.Mortgage'.
13:51:37,014 INFO  [ReloadableActionMappingRepository] Reloading action: org.loom.demo.action.ebanking.MortgagesAction
13:51:37,015 DEBUG [ActionMapping$$M$38b15290] Available events for org.loom.demo.action.ebanking.MortgagesAction are [ save, preEdit, delete, listAll ]
13:51:37,015 DEBUG [AnnotationProcessorRepository] Start processing annotations for org.loom.demo.action.ebanking.MortgagesAction

Notice that modifications to existing Actions will be detected, but new Action classes will not.