JRebel Reference Manual

©ZeroTurnaround OÜ, Estonia, Tartu


Prev  Home  Next
3. Application Configuration 5. Agent Configuration

4. Server Configuration

4.1 Quick Start
4.2 Eclipse
4.3 MyEclipse 9.1 or later
4.4 IntelliJ IDEA 8.x, 9.x
4.5 IntelliJ IDEA X or later
4.6 Java 5.x or later (Sun or JRockit JVM)
4.6.1 Standalone Applications on Windows
4.6.2 Standalone Applications on Linux/Mac OS X
4.6.3 Apache Geronimo on Windows
4.6.4 Apache Geronimo on Linux/Mac OS X
4.6.5 Google App Engine 1.x on Windows
4.6.6 Google App Engine 1.x on Linux/Mac OS X
4.6.7 Google Web Toolkit on Windows
4.6.8 Google Web Toolkit on Linux/Mac OS X
4.6.9 GlassFish V2, V3 on Windows
4.6.10 GlassFish V2, V3 on Linux/Mac OS X
4.6.11 JBoss 4.x, 5.x, 6.x on Windows
4.6.12 JBoss 4.x, 5.x, 6.x on Linux/Mac OS X
4.6.13 JBoss 7.x on Windows
4.6.14 JBoss 7.x on Linux/Mac OS X
4.6.15 Jetty 5.x, 6.x, 7.x on Windows
4.6.16 Jetty 5.x, 6.x, 7.x on Linux/Mac OS X
4.6.17 Jetty 8.x on Windows
4.6.18 Jetty 8.x on Linux/Mac OS X
4.6.19 Maven Jetty plugin (mvn jetty:run) on Windows
4.6.20 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X
4.6.21 Oracle Application Server 10.x on Windows
4.6.22 Oracle Application Server 10.x on Linux/Mac OS X
4.6.23 Oracle Application Server 9.x on Windows
4.6.24 Oracle Application Server 9.x on Linux/Mac OS X
4.6.25 Caucho Resin 3.1.x, 4.x on Windows
4.6.26 Caucho Resin 3.1.x, 4.x on Linux/Mac OS X
4.6.27 Caucho Resin 3.0.x on Windows
4.6.28 Caucho Resin 3.0.x on Linux/Mac OS X
4.6.29 SAP NetWeaver 7.1.x on Windows
4.6.30 SAP NetWeaver 7.1.x on Linux/Mac OS X
4.6.31 SpringSource dm Platform (Eclipse Virgo) on Windows
4.6.32 SpringSource dm Platform (Eclipse Virgo) on Linux/Mac OS X
4.6.33 Spring tc Server on Windows
4.6.34 Spring tc Server on Linux/Mac OS X
4.6.35 Tomcat 4.x, 5.x, 6.x, 7.x on Windows
4.6.36 Tomcat 4.x, 5.x, 6.x, 7.x on Linux/Mac OS X
4.6.37 MuleSoft TCat on Windows
4.6.38 MuleSoft TCat on Linux/Mac OS X
4.6.39 Oracle Weblogic 9.x, 10.x, 12.x on Windows
4.6.40 Oracle Weblogic 9.x, 10.x, 12.x on Linux/Mac OS X
4.6.41 IBM WebSphere AS CE on Windows
4.6.42 IBM WebSphere AS CE on Linux/Mac OS X
4.6.43 Other on Windows
4.6.44 Other on Linux/Mac OS X
4.7 Java 1.4.x (Sun or JRockit JVM)
4.7.1 Standalone Applications on Windows
4.7.2 Standalone Applications on Linux/Mac OS X
4.7.3 JBoss 4.x on Windows
4.7.4 JBoss 4.x on Linux/Mac OS X
4.7.5 Jetty 5.x, 6.x on Windows
4.7.6 Jetty 5.x, 6.x on Linux/Mac OS X
4.7.7 Maven Jetty plugin (mvn jetty:run) on Windows
4.7.8 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X
4.7.9 Oracle Application Server 10.x on Windows
4.7.10 Oracle Application Server 10.x on Linux/Mac OS X
4.7.11 Oracle Application Server 9.x on Windows
4.7.12 Oracle Application Server 9.x on Linux/Mac OS X
4.7.13 Caucho Resin 3.0.x on Windows
4.7.14 Caucho Resin 3.0.x on Linux/Mac OS X
4.7.15 SAP NetWeaver 7.0.x on Windows
4.7.16 SAP NetWeaver 7.0.x on Linux/Mac OS X
4.7.17 Tomcat 4.x, 5.0.x on Windows
4.7.18 Tomcat 4.x, 5.0.x on Linux/Mac OS X
4.7.19 Oracle Weblogic 7.x, 8.x on Windows
4.7.20 Oracle Weblogic 7.x, 8.x on Linux/Mac OS X
4.8 IBM JVM (Java 1.4.x or later)
4.8.1 IBM WebSphere 6.0.x, 6.1.x, 7.x on Windows
4.8.2 IBM WebSphere 6.0.x, 6.1.x, 7.x on Linux/Mac OS X
4.8.3 Other servers or applications using IBM JDK on Windows
4.8.4 Other servers or applications using IBM JDK on Linux/Mac OS X

4.1 Quick Start

Make sure that your IDE compiles Java classes to the same location where JRebel reads 'em from.

4.2 Eclipse

Automatic publishing should be disabled in the server configuration. Double click on your server name and a configuration page opens. Under the Publish section you should have the Never publish automatically option selected as shown in the following screenshot below. To start the server with JRebel enabled, check the corresponding checkbox (Enable JRebel agent) in JRebel Integration section.


wtp-server


If you run a standalone application you can enable JRebel for its launch configuration.


launch

4.3 MyEclipse 9.1 or later

To start the server with JRebel enabled, check the corresponding checkbox (Enable JRebel agent) in JRebel settings section.


myeclipse-server


If you run a standalone application you can enable JRebel for its launch configuration.


launch

4.4 IntelliJ 8.x, 9.x

This plugin introduces new launch buttons. One for starting the container with JRebel and the other for starting the container in debug mode with JRebel enabled.


Launching container with JavaRebel


4.5 IntelliJ X or later

This plugin introduces new launch buttons. One for starting the container with JRebel and the other for starting the container in debug mode with JRebel enabled.


Launching container with JavaRebel


4.6 Java 5.x or later (Sun or JRockit JVM)

4.6.1 Standalone Applications on Windows

Just run as usual adding the integration string:

java -javaagent:%REBEL_HOME%\jrebel.jar MAIN_CLASS ARGS

For instance:

java -javaagent:c:\JRebel\jrebel.jar foo.bar.MyServer

While developing IntelliJ IDEA or Eclipse plugins start the respected testing IDE instance with the integration string.

4.6.2 Standalone Applications on Linux/Mac OS X

Just run as usual adding the integration string:

java -javaagent:$REBEL_HOME/jrebel.jar MAIN_CLASS ARGS

For instance:

java -javaagent:/opt/jrebel/jrebel.jar foo.bar.MyServer

While developing IntelliJ IDEA or Eclipse plugins start the respected testing IDE instance with the integration string.

4.6.3 Apache Geronimo on Windows

Go to %GERONIMO_HOME%\bin and create the file geronimo-jrebel.bat with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m %JAVA_OPTS%
call "%~dp0\geronimo.bat" %*

Use this command file instead of geronimo.bat if you want to run Geronimo with JRebel.

> geronimo.bat run

4.6.4 Apache Geronimo on Linux/Mac OS X

Go to $GERONIMO_HOME/bin and create the file geronimo-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTS"
`dirname $0`/geronimo.sh $@

Use this script instead of geronimo.sh if you want to run Geronimo with JRebel.

> geronimo.sh run

4.6.5 Google App Engine 1.x on Windows

File: %GAE_HOME%\bin\dev_appserver.cmd

Add the following line after com.google.appengine.tools.KickStart:

--jvm_flag=-javaagent:%REBEL_HOME%\jrebel.jar ^

4.6.6 Google App Engine 1.x on Linux/Mac OS X

File: $GAE_HOME/bin/dev_appserver.sh

Add the following line after com.google.appengine.tools.KickStart:

--jvm_flag=-javaagent:$REBEL_HOME/jrebel.jar \

4.6.7 Google Web Toolkit on Windows

Google Web Toolkit uses Apache Ant to start a web container, either Jetty or Tomcat, along with the GWT application. Thus, to enable JReble for GWT in development mode, one should set ANT_OPTS environment variable accordingly.

Go to the GWT project directory, and create run-jrebel.cmd file with the following content:

    @echo off
    set ANT_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar
    ant devmode

Now use run-jrebel.cmd to run your GWT application in development mode with JRebel enabled.

4.6.8 Google Web Toolkit on Linux/Mac OS X

Google Web Toolkit uses Apache Ant to start a web container, either Jetty or Tomcat, along with the GWT application. Thus, to enable JReble for GWT in development mode, one should set ANT_OPTS environment variable accordingly.

Go to the GWT project directory, and create run-jrebel.sh file with the following content:

    #!/bin/bash
    export ANT_OPTS=-javaagent:$REBEL_HOME/jrebel.jar
    ant devmode

Now use run-jrebel.sh to run your GWT application in development mode with JRebel enabled.

4.6.9 GlassFish V2, V3 on Windows

In the Administration Console open Configuration » JVM Settings » JVM Options

Use the Add JVM Option button to insert the following option:

-javaagent:%REBEL_HOME%\jrebel.jar

Press Save and restart the server.

4.6.10 GlassFish V2, V3 on Linux/Mac OS X

In the Administration Console open Configuration » JVM Settings » JVM Options

Use the Add JVM Option button to insert the following option:

-javaagent:$REBEL_HOME/jrebel.jar

Press Save and restart the server.

4.6.11 JBoss 4.x, 5.x, 6.x on Windows

Go to %JBOSS_HOME%\bin and create the file run-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m %JAVA_OPTS%
call "%~dp0\run.bat" %*

Use this command file instead of run.bat if you want to run JBoss with JRebel.

4.6.12 JBoss 4.x, 5.x, 6.x on Linux/Mac OS X

Go to $JBOSS_HOME/bin and create the file run-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTS"
`dirname $0`/run.sh $@

Use this script instead of run.sh if you want to run JBoss with JRebel.

4.6.13 JBoss 7.x on Windows

Go to %JBOSS_HOME%\bin and create the file standalone-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m %JAVA_OPTS%
call "%~dp0\standalone.bat" %*

Use this command file instead of standalone.bat if you want to run JBoss with JRebel.

4.6.14 JBoss 7.x on Linux/Mac OS X

Go to $JBOSS_HOME/bin and create the file standalone-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTS"
`dirname $0`/standalone.sh $@

Use this script instead of standalone.sh if you want to run JBoss with JRebel.

4.6.15 Jetty 5.x, 6.x, 7.x on Windows

Since Jetty does not have any startup scripts for Windows just add the following line to the command line:

 -javaagent:%REBEL_HOME%\jrebel.jar

4.6.16 Jetty 5.x, 6.x, 7.x on Linux/Mac OS X

The newer Jetty distributions (starting from 6.x) come with the bin/jetty.sh script in the Jetty's installation directory.

Go to $JETTY_HOME/bin and create the file run-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTS"
`dirname $0`/jetty.sh $@

Use this script instead of jetty.sh if you want to run Jetty with JRebel.

4.6.17 Jetty 8.x on Windows

Since Jetty does not have any startup scripts for Windows just add the following line to the command line:

 -javaagent:%REBEL_HOME%\jrebel.jar

4.6.18 Jetty 8.x on Linux/Mac OS X

Go to $JETTY_HOME/bin and create the file jetty-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTIONS="-javaagent:$REBEL_HOME/jrebel.jar -Xms256m -Xmx512m -XX:MaxPermSize=256m $JAVA_OPTIONS"
`dirname $0`/jetty.sh $@

Use this script instead of jetty.sh if you want to run Jetty with JRebel.

4.6.19 Maven Jetty plugin (mvn jetty:run) on Windows

Edit your pom.xml file and set the scanIntervalSeconds param to 0, this will turn off Jetty's internal reloading. It should look like this:
<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>

Add the following line to the MAVEN_OPTS environment variable:

-javaagent:%REBEL_HOME%\jrebel.jar

To do it in the console:

  > set MAVEN_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %MAVEN_OPTS%
  > mvn jetty:run

4.6.20 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X

Edit your pom.xml file and set the scanIntervalSeconds param to 0, this will turn off Jetty's internal reloading. It should look like this:
<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>

Add the following line to the MAVEN_OPTS environment variable:

-javaagent:$REBEL_HOME/jrebel.jar

To do it in the console:

  > export MAVEN_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $MAVEN_OPTS"
  > mvn jetty:run

4.6.21 Oracle Application Server 10.x on Windows

Go to %ORACLE10_HOME%\bin and create the file run-oc4j.cmd with the following contents:


set OC4J_JVM_ARGS=-javaagent:%REBEL_HOME%\jrebel.jar %OC4J_JVM_ARGS%
call "%~dp0\oc4j.cmd" %*

Use this command file instead of oc4j.cmd if you want to run OC4J with JRebel.

4.6.22 Oracle Application Server 10.x on Linux/Mac OS X

Go to $ORACLE10_HOME/bin and create the file oc4j-jrebel.sh with the following contents:


#!/bin/bash
export OC4J_JVM_ARGS="-javaagent:$REBEL_HOME/jrebel.jar $OC4J_JVM_ARGS"
`dirname $0`/oc4j $@

Use this script instead of oc4j if you want to run OC4J with JRebel.

4.6.23 Oracle Application Server 9.x on Windows

Go to folder %ORACLE9_HOME%\j2ee\home and start the server with the following command:

java -javaagent:%REBEL_HOME%\jrebel.jar -jar oc4j.jar

4.6.24 Oracle Application Server 9.x on Linux/Mac OS X

Go to folder $ORACLE9_HOME/j2ee/home and start the server with the following command:

java -javaagent:$REBEL_HOME/jrebel.jar -jar oc4j.jar

4.6.25 Caucho Resin 3.1.x, 4.x on Windows

To start Resin server with JRebel from %RESIN_HOME% use the following command line:

java -javaagent:%REBEL_HOME%\jrebel.jar -jar lib\resin.jar

4.6.26 Caucho Resin 3.1.x, 4.x on Linux/Mac OS X

Replace the last line of $RESIN_HOME/bin/httpd.sh (or resin.sh in Resin 3.2+) with the following:

exec $JAVA_EXE -javaagent:$REBEL_HOME/jrebel.jar -jar $RESIN_HOME/lib/resin.jar $*

4.6.27 Caucho Resin 3.0.x on Windows

Start httpd.exe with parameters

httpd.exe -J-javaagent:%REBEL_HOME%\jrebel.jar

4.6.28 Caucho Resin 3.0.x on Linux/Mac OS X

Modify $RESIN_HOME/bin/wrapper.pl $JAVA_ARGS variable to include the line:

-javaagent:$REBEL_HOME/jrebel.jar

4.6.29 SAP NetWeaver 7.1.x on Windows

Use Configuration management console to add the following parameters to the JVM:

-javaagent:%REBEL_HOME%\jrebel.jar

4.6.30 SAP NetWeaver 7.1.x on Linux/Mac OS X

Use Configuration management console to add the following parameters to the JVM:

-javaagent:$REBEL_HOME/jrebel.jar

4.6.31 SpringSource dm Platform (Eclipse Virgo) on Windows

Edit files "%PLATFORM_HOME%\lib\java5-platform.profile" and "%PLATFORM_HOME%\lib\java6-platform.profile". Add "com.zeroturnaround.*,\" and "org.zeroturnaround.*,\" to the property "org.osgi.framework.bootdelegation".

File: %PLATFORM_HOME%\bin\startup.bat

Add the following line:

set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%

4.6.32 SpringSource dm Platform (Eclipse Virgo) on Linux/Mac OS X

Edit files "$PLATFORM_HOME/lib/java5-platform.profile" and "$PLATFORM_HOME/lib/java6-platform.profile". Add "com.zeroturnaround.*,\" and "org.zeroturnaround.*,\" to the property "org.osgi.framework.bootdelegation".

File: $PLATFORM_HOME/bin/startup.sh

Add the following line:

 JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"

4.6.33 Spring tc Server on Windows

Go to %SPRING_TC_HOME%, choose the Tomcat instance (%CATALINA_BASE%) you would like to run.

Open the %CATALINA_BASE%\conf\wrapper.conf configuration file for editing.

In the Java Additional Parameters section, add the additional wrapper.java.additional.* properties:

wrapper.java.additional.10=-javaagent:%REBEL_HOME%\jrebel.jar

Use the %SPRING_TC_HOME%\tcruntime-ctl.bat script to start Tomcat instances as usual.

4.6.34 Spring tc Server on Linux/Mac OS X

Go to $SPRING_TC_HOME, choose the Tomcat instance ($CATALINA_BASE) you would like to run.

Open the $CATALINA_BASE/conf/wrapper.conf configuration file for editing.

In the Java Additional Parameters section, add the additional wrapper.java.additional.* properties:

wrapper.java.additional.10=-javaagent:$REBEL_HOME/jrebel.jar

Use the $SPRING_TC_HOME/tcruntime-ctl.bat script to start Tomcat instances as usual.

4.6.35 Tomcat 4.x, 5.x, 6.x, 7.x on Windows

Go to %TOMCAT_HOME%\bin and create the file startup-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\startup.bat" %*

You can also create a catalina-jrebel.cmd with the following content:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\catalina.bat" %*

Use those command files instead of startup.bat and catalina.bat if you want to run Tomcat with JRebel.

If you're running Tomcat as a service please open the tomcatXw.exe wrapper (or double click the Tomcat icon in the system tray) and insert the following line into the Java » Java Options textbox:

-javaagent:%REBEL_HOME%\jrebel.jar

as shown on the following screenshot:

4.6.36 Tomcat 4.x, 5.x, 6.x, 7.x on Linux/Mac OS X

Go to $TOMCAT_HOME/bin and create the file startup-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/startup.sh $@

You can also create a catalina-jrebel.sh with the following content:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/catalina.sh $@

Make them executable and use those scripts instead of startup.sh and catalina.sh if you want to run Tomcat with JRebel.

4.6.37 MuleSoft TCat on Windows

Go to %TCAT_HOME%\bin and create the file startup-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\startup.bat" %*

You can also create a catalina-jrebel.cmd with the following content:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\catalina.bat" %*

Use those command files instead of startup.bat and catalina.bat if you want to run TCat with JRebel.

If you're running TCat as a service please open the TcatServerw.exe wrapper (or double click the TCat icon in the system tray) and insert the following line into the Java » Java Options textbox:

-javaagent:%REBEL_HOME%\jrebel.jar

as shown on the following screenshot:

4.6.38 MuleSoft TCat on Linux/Mac OS X

Go to $TCAT_HOME/bin and create the file startup-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/startup.sh $@

You can also create a catalina-jrebel.sh with the following content:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/catalina.sh $@

Make them executable and use those scripts instead of startup.sh and catalina.sh if you want to run TCat with JRebel.

4.6.39 Oracle Weblogic 9.x, 10.x, 12.x on Windows

Go to %DOMAIN_HOME%\bin and create the file startWeblogic-jrebel.cmd with the following contents:


@echo off
set JAVA_OPTIONS=-javaagent:%REBEL_HOME%\jrebel.jar %JAVA_OPTIONS%
call "%~dp0\startWebLogic.cmd" %*

Use this command file instead of startWeblogic.cmd if you want to run Weblogic with JRebel.

It is highly recommended to avoid using class caching (CLASS_CACHE=true) because in some cases it may prevent classes and resources from being reloaded.

4.6.40 Oracle Weblogic 9.x, 10.x, 12.x on Linux/Mac OS X

Go to $DOMAIN_HOME/bin and create the file startWeblogic-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTIONS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTIONS"
`dirname $0`/startWebLogic.sh $@

Use this script instead of startWeblogic.sh if you want to run Weblogic with JRebel.

It is highly recommended to avoid using class caching (CLASS_CACHE=true) because in some cases it may prevent classes and resources from being reloaded.

4.6.41 IBM WebSphere AS CE on Windows

Go to %WEBSPHERE_CE_HOME%\bin and create the file startup-jrebel.bat with the following contents:


@echo off
set JAVA_OPTS=-javaagent:%REBEL_HOME%\jrebel.jar
call "%~dp0\startup.bat" %*

Use this command file instead of startup.bat if you want to run WebSphere CE with JRebel.

4.6.42 IBM WebSphere AS CE on Linux/Mac OS X

Go to $WEBSPHERE_CE_HOME/bin and create the file startup-jrebel.sh with the following contents:


#!/bin/bash
export JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar"
`dirname $0`/startup.sh $@

Use this script instead of startup.sh if you want to run WebSphere CE with JRebel.

4.6.43 Other on Windows

If JRebel doesn't work with your application or container it is most probably due to some custom classloaders that don't behave as we expect them to. You need to determine the class name of the classloader in question. The easiest way to do it is put the following line in any class that will be loaded by that classloader (e.g. in a web application case it could be a servlet class):

System.out.println(getClass().getClassLoader().getClass().getName());

This will print the name of the classloader class right out to the console. Let's assume the name was "com.acme.CustomClassLoader". In that case all we need to do is pass it to the JRebel agent like this:

-javaagent:%REBEL_HOME%\jrebel.jar=com.acme.CustomClassLoader

Sometimes there could be several different custom classloaders and in such a case a comma-separated syntax should be used:

-javaagent:%REBEL_HOME%\jrebel.jar=com.acme.CustomClassLoader1,com.acme.CustomClassLoader2,...

This should get most of the custom classloaders to work.

4.6.44 Other on Linux/Mac OS X

If JRebel doesn't work with your application or container it is most probably due to some custom classloaders that don't behave as we expect them to. You need to determine the class name of the classloader in question. The easiest way to do it is put the following line in any class that will be loaded by that classloader (e.g. in a web application case it could be a servlet class):

System.out.println(getClass().getClassLoader().getClass().getName());

This will print the name of the classloader class right out to the console. Let's assume the name was "com.acme.CustomClassLoader". In that case all we need to do is pass it to the JRebel agent like this:

-javaagent:$REBEL_HOME/jrebel.jar=com.acme.CustomClassLoader

Sometimes there could be several different custom classloaders and in such a case a comma-separated syntax should be used:

-javaagent:$REBEL_HOME/jrebel.jar=com.acme.CustomClassLoader1,com.acme.CustomClassLoader2,...

This should get most of the custom classloaders to work.

4.7 Java 1.4.x (Sun or JRockit JVM)

4.7.1 Standalone Applications on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add this arguments to the JVM command line:

java -noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar MAIN_CLASS ARGS

4.7.2 Standalone Applications on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add this arguments to the JVM command line:

java -noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar;$REBEL_HOME/jrebel.jar MAIN_CLASS ARGS

4.7.3 JBoss 4.x on Windows

Go to %JBOSS_HOME%\bin and create the file run-jrebel.cmd with the following contents:


@echo off
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar  
set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\run.bat" %*

Use this command file instead of run.bat if you want to run JBoss with JRebel.

4.7.4 JBoss 4.x on Linux/Mac OS X

Go to $JBOSS_HOME/bin and create the file run-jrebel.sh with the following contents:


#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export JAVA_OPTS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/run.sh $@

Use this script instead of run.sh if you want to run JBoss with JRebel.

4.7.5 Jetty 5.x, 6.x on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add the following line to the JVM command line:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

4.7.6 Jetty 5.x, 6.x on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add the following line to the JVM command line:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar;$REBEL_HOME/jrebel.jar

4.7.7 Maven Jetty plugin (mvn jetty:run) on Windows

Edit your pom.xml file and set the scanIntervalSeconds param to 0, this will turn off Jetty's internal reloading. It should look like this:
<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add the following line to the MAVEN_OPTS environment variable:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

To do it in the console:

  > java -jar %REBEL_HOME%\jrebel.jar
  > set MAVEN_OPTS=-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar %MAVEN_OPTS%
  > mvn jetty:run

4.7.8 Maven Jetty plugin (mvn jetty:run) on Linux/Mac OS X

Edit your pom.xml file and set the scanIntervalSeconds param to 0, this will turn off Jetty's internal reloading. It should look like this:
<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>0</scanIntervalSeconds>
  </configuration>
</plugin>

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Add the following line to the MAVEN_OPTS environment variable:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

To do it in the console:

  > java -jar $REBEL_HOME/jrebel.jar
  > export MAVEN_OPTS="-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar $MAVEN_OPTS"
  > mvn jetty:run
  

4.7.9 Oracle Application Server 10.x on Windows

Go to %ORACLE10_HOME%\bin and create the file oc4j-jrebel.cmd with the following contents:


set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar  
set OC4J_JVM_ARGS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %OC4J_JVM_ARGS%
call "%~dp0\oc4j.cmd" %*

Use this command file instead of oc4j.cmd if you want to run OC4J with JRebel.

4.7.10 Oracle Application Server 10.x on Linux/Mac OS X

Go to $ORACLE10_HOME/bin and create the file oc4j-jrebel.sh with the following contents:


#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export OC4J_JVM_ARGS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $OC4J_JVM_ARGS"
`dirname $0`/oc4j $@

Make it executable and use this script instead of oc4j.sh if you want to run OC4J with JRebel.

4.7.11 Oracle Application Server 9.x on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Go to folder %ORACLE9_HOME%\j2ee\home and start the server with the following command:

java -noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar -jar oc4j.jar

4.7.12 Oracle Application Server 9.x on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Go to folder $ORACLE9_HOME/j2ee/home and start the server with the following command:

java -noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar -jar oc4j.jar

4.7.13 Caucho Resin 3.0.x on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Start httpd.exe with parameters

httpd.exe -J-noverify -J-Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

4.7.14 Caucho Resin 3.0.x on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Modify RESIN_HOME/bin/wrapper.pl $JAVA_ARGS variable to include the line:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

4.7.15 SAP NetWeaver 7.0.x on Windows

Run java -jar %REBEL_HOME%\jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Use Configuration management console to add the following parameters to the JVM:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar:%REBEL_HOME%\jrebel.jar

4.7.16 SAP NetWeaver 7.0.x on Linux/Mac OS X

Run java -jar $REBEL_HOME/jrebel.jar to generate the jrebel-bootstrap.jar using the JVM you will run the application with.

Use Configuration management console to add the following parameters to the JVM:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

4.7.17 Tomcat 4.x, 5.0.x on Windows

Go to %TOMCAT_HOME%\bin and create the file startup-jrebel.cmd with the following contents:


@echo off
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar  
set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\startup.bat" %*

You can also create a catalina-jrebel.cmd with the following content:


@echo off
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar  
set JAVA_OPTS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %JAVA_OPTS%
call "%~dp0\catalina.bat" %*

Use those command files instead of startup.bat and catalina.bat if you want to run Tomcat with JRebel.

If you're running Tomcat as a Windows service then first generate the jrebel-bootstrap.jar by running java -jar %REBEL_HOME%\jrebel.jar using the JVM you will run the application with. Then open the tomcatXw.exe wrapper (or double click the Tomcat icon in the system tray) and insert the following line into the Java » Java Options textbox:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

as shown on the following screenshot:

4.7.18 Tomcat 4.x, 5.0.x on Linux/Mac OS X

Go to $TOMCAT_HOME/bin and create the file startup-jrebel.sh with the following contents:


#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export JAVA_OPTS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/startup.sh $@

You can also create a catalina-jrebel.sh with the following content:


#!/bin/bash
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export JAVA_OPTS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
`dirname $0`/catalina.sh $@

Make them executable and use those scripts instead of startup.sh and catalina.sh if you want to run Tomcat with JRebel.

4.7.19 Oracle Weblogic 7.x, 8.x on Windows

Go to %DOMAIN_HOME% and create the file startWebLogic-jrebel.cmd with the following contents:


@echo off
call setEnv.cmd
set JREBEL_BOOTSTRAP="%~dp0\jrebel-bootstrap.jar"
java -Drebel.bootstrap=%JREBEL_BOOTSTRAP% -jar %REBEL_HOME%\jrebel.jar
set JAVA_OPTIONS=-noverify -Xbootclasspath/p:%JREBEL_BOOTSTRAP%;%REBEL_HOME%\jrebel.jar %JAVA_OPTIONS%
call "%~dp0\startWebLogic.cmd" %*

Use this command file instead of startWebLogic.cmd if you want to run Weblogic with JRebel.

4.7.20 Oracle Weblogic 7.x, 8.x on Linux/Mac OS X

Go to $DOMAIN_HOME and create the file startWebLogic-jrebel.sh with the following contents:


#!/bin/bash
`dirname $0`/setEnv.sh
JREBEL_BOOTSTRAP=`dirname $0`/jrebel-bootstrap.jar
java -Drebel.bootstrap=$JREBEL_BOOTSTRAP -jar $REBEL_HOME/jrebel.jar
export JAVA_OPTIONS="-noverify -Xbootclasspath/p:$JREBEL_BOOTSTRAP:$REBEL_HOME/jrebel.jar $JAVA_OPTIONS"
`dirname $0`/startWebLogic.sh $@

Use this script instead of startWebLogic.sh if you want to run Weblogic with JRebel.

4.8 IBM JVM

4.8.1 IBM WebSphere 6.0.x, 6.1.x, 7.x on Windows

Make sure that JRebel installation folder doesn't contain spaces.

Generate the jrebel-bootstrap.jar by running java -jar %REBEL_HOME%\jrebel.jar using the JVM you will run the application server with (you can also add this line to the startServer.sh after the environment is set).

Start the IBM WebSphere server and run the Administrative Console.

2009-07-03_132313

In the Administration Console open Servers » Application Servers and select the server your app is deployed to.

2009-07-03_132842

Select Java and Process Management» Process Definition.

2009-07-03_133200

Select Java Virtual Machine.

2009-07-03_133350

Insert the following line into Generic JVM arguments for Websphere 6.1 or later running on IBM JDK 5 or later:

-noverify -Xshareclasses:none -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

Insert the following line into Generic JVM arguments for Websphere 6.0 or later running on IBM JDK 1.4:

-noverify -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

2009-07-03_133601

Press OK, when asked, Save the master configuration and restart the server.

4.8.2 IBM WebSphere 6.0.x, 6.1.x, 7.x on Linux/Mac OS X

Generate the jrebel-bootstrap.jar by running java -jar $REBEL_HOME/jrebel.jar using the JVM you will run the application server with (you can also add this line to the startServer.sh after the environment is set).

Start the IBM WebSphere server and run the Administrative Console.

2009-07-03_132313

In the Administration Console open Servers » Application Servers and select the server your app is deployed to.

2009-07-03_132842

Select Java and Process Management» Process Definition.

2009-07-03_133200

Select Java Virtual Machine.

2009-07-03_133350

Insert the following line into Generic JVM arguments for Websphere 6.1 or later running on IBM JDK 5 or later:

-noverify -Xshareclasses:none -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

Insert the following line into Generic JVM arguments for Websphere 6.0 or later running on IBM JDK 1.4:

-noverify -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar

2009-07-03_133601

Press OK, when asked, Save the master configuration and restart the server.

4.8.3 Other servers or applications using IBM JDK on Windows

Generate the jrebel-bootstrap.jar by running java -jar %REBEL_HOME%\jrebel.jar using the JVM you will run the application server with.

Start your application with the extra java options -noverify -Xshareclasses:none -Xbootclasspath/p:%REBEL_HOME%\jrebel-bootstrap.jar;%REBEL_HOME%\jrebel.jar

4.8.4 Other servers or applications using IBM JDK on Linux/Mac OS X

Generate the jrebel-bootstrap.jar by running java -jar $REBEL_HOME/jrebel.jar using the JVM you will run the application server with.

Start your application with the extra java options -noverify -Xshareclasses:none -Xbootclasspath/p:$REBEL_HOME/jrebel-bootstrap.jar:$REBEL_HOME/jrebel.jar


Prev  Home  Next
3. Application Configuration 5. Agent Configuration

JRebel Reference Manual, ©ZeroTurnaround OÜ, Estonia, Tartu