Skip to content

Instantly share code, notes, and snippets.

@maxandersen
Created December 18, 2012 14:23
Show Gist options
  • Save maxandersen/4328397 to your computer and use it in GitHub Desktop.
Save maxandersen/4328397 to your computer and use it in GitHub Desktop.
JRebel remoting on OpenShift

How to get JRebel working on OpenShift

  1. Get an jrebel license file (jrebel.lic) from http://zeroturnaround.com/software/jrebel/offline-registration/ or by using the Eclipse tooling signup form.

  2. Create or add the following items to your AS7 or EAP6 application:

    a) mkdir /.jrebel

    b) cp jrebel.lic /.jrebel/jrebel.lic

    c) cp jrebel.jar /.jrebel/jrebel.jar

    The presence of .jrebel/jrebel.jar is what we'll use to know if the jrebel agent should be added or not.

  3. Add the following to /.openshift/action_hooks/pre_start_jboss

    export JAVA_OPTS="-javaagent:${OPENSHIFT_REPO_DIR}/.jrebel/jrebel.jar -Drebel.log=true -Drebel.log.file=${OPENSHIFT_REPO_DIR}/.jrebel/jrebel.log -Duser.home=${OPENSHIFT_REPO_DIR} -Drebel.remoting_plugin=true"

  4. Make sure you have created rebel.xml + rebel-remote.xml via the eclipse tooling (or manually)

    The content automatically generated should suffice - no need to mess with it; ignore its using machine specific paths - it will work.

  5. Now remember to git add and commit all this before you do git push. Note: the git push might report it cannot startup EAP6/AS7 - unless you made an error in above it is just caused by jrebel taking a bit longer to start but eventually your app should be ready.

  6. Go set http://app-domain.rhcloud.com/ as the remote url in eclipse tooling.

Voila - you should be all ready to go and use jrebel remoting on OpenShift and have changes propogated more or less instantly via JRebel > Synchronize (or enable it to be automatically done for each build)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment