Installation

Download and setup

  1. Log in and download the XRebel Hub agent from http://hub.xrebel.com/.
  2. Add the following parameter to JVM arguments for the application server. Make sure the path that you refer to contains the xrebel-hub-agent.jar file:
-javaagent:[path/to/]xrebel-hub-agent.jar

Using multiple agents in the same JVM process? You need to specify the -javaagent parameter for every agent:

-javaagent:[path/to/]xrebel-hub-agent.jar -javaagent:[path/to/]xrebel-hub-agent.jar
  1. And you are done! Launch your server and application. The agent will start sending profiling data to the XRebel Hub servers as soon as it is successfully launched.

Adding XRebel Hub to your server

Having trouble getting XRebel Hub to work with your application server? This chapter details the correct examples for how to add the JVM parameter to your server startup, using either an IDE or running your server without it. You need to define the XRebel Hub agent within your server’s startup script. This chapter provides XRebel Hub agent running examples for servers that are supported.


GlassFish

  1. Access your GlassFish Administration Console.
  2. Open Configuration > JVM Settings > JVM Options.
  3. Press Add JVM Option and insert the following:
-javaagent:[path/to/]xrebel-hub-agent.jar
  1. Press Save and don’t forget to restart your server.

JBoss

JBoss on Windows

  1. Access your JBoss home folder.
  2. Open the bin folder.
  3. Add the following line at the end of standalone.conf.bat:
JAVA_OPTS=“-javaagent:[path/to/]xrebel-hub-agent.jar $JAVA_OPTS
  1. Save the file and start JBoss.

JBoss on Mac OS and Linux

  1. Access your JBoss home folder.
  2. Open the bin folder.
  3. Add the following line at the end of standalone.conf:
JAVA_OPTS=“-javaagent:[path/to/]xrebel-hub-agent.jar $JAVA_OPTS
  1. Save the file and start JBoss.

JBoss Domain

  1. Access your JBoss Domain configuration folder JBOSS_HOME/domain/configuration.

  2. Open configuration.xml.

  3. Locate your desired server group.

  4. Add the following option to the configuration:

    <jvm-options>
      <option value="-javaagent:[path/to/]xrebel-hub-agent.jar"/>
    </jvm-options>
    
  5. Save configuration.xml and restart the server.


Jetty

Jetty on Windows

  1. Add the following to the command line:
-javaagent:[path/to/]xrebel-hub-agent.jar
  1. Run Jetty.

Jetty on Mac OS and Linux

  1. Access your Jetty home folder.
  2. Open the bin folder.
  3. Add the following line in jetty.sh after the line # JAVA_OPTIONS:
JAVA_OPTIONS=“-javaagent:[path/to/]xrebel-hub-agent.jar $JAVA_OPTIONS
  1. Save the file and start Jetty.

Resin

  1. Access your Resin home folder.
  2. Open the conf folder.
  3. Edit the resin.properties file. Locate jvm_args.
  4. Add the XRebel parameter:
jvm_args=-javaagent:[path/to]xrebel-hub-agent.jar
  1. Save the file and start Resin.

Note

Alternatively, you can include the XRebel parameter in the resin.xml file. To do this, add the following within the <server> tags: <jvm-arg>-javaagent:[path/to]xrebel-hub-agent.jar</jvm-arg>

Warning

You only need to configure the JVM parameter once. Pick either the properties file or the xml file. Do not add the JVM parameter in both places.


Tomcat

Tomcat on Windows

  1. Access your Tomcat home folder.
  2. Open the bin folder.
  3. Add the following line to catalina.bat:
CATALINA_OPTS=“-javaagent:[path/to/]xrebel-hub-agent.jar $CATALINA_OPTS
  1. Save the file and start Tomcat.

Tomcat on Mac OS and Linux

  1. Access your Tomcat home folder.
  2. Open the bin folder.
  3. Add the following line to catalina.sh:
CATALINA_OPTS=“-javaagent:[path/to/]xrebel-hub-agent.jar $CATALINA_OPTS
  1. Save the file and start Tomcat.

WebLogic

WebLogic on Windows

  1. Access your WebLogic home folder.
  2. Open the bin folder.
  3. Add the following line to startWebLogic.cmd after the setDomainEnv.sh call:
JAVA_OPTIONS=“-javaagent:[path/to/]xrebel-hub-agent.jar ${JAVA_OPTIONS}
  1. Save the file and start WebLogic.

WebLogic on Mac OS and Linux

  1. Access your WebLogic home folder.
  2. Open the bin folder.
  3. Add the following line to startWebLogic.sh after the setDomainEnv.sh call:
JAVA_OPTIONS=“-javaagent:[path/to/]xrebel-hub-agent.jar ${JAVA_OPTIONS}
  1. Save the file and start WebLogic.

WebSphere

Windows

  1. Start the IBM WebSphere server and open the administrative console.
  2. In the Admin Console open Servers > Application servers. Select the server your application is deployed to.
  3. Select Java and Process Management > Process Definition.
  4. Select Java Virtual Machine.
  5. Insert the following line into Generic JVM arguments for WebSphere:
-noverify -Xshareclasses:none -javaagent:[c:\path\to\]xrebel-hub-agent.jar
  1. Press OK. When asked, save the master configuration and restart the server.

Linux and Mac OS

  1. Start the IBM WebSphere server and open the administrative console.
  2. In the Administration Console open Servers > Application Servers. Select the server your application is deployed to.
  3. Select Java and Process Management > Process Definition.
  4. Select Java Virtual Machine.
  5. Insert the following line into Generic JVM arguments for WebSphere:
-noverify -Xshareclasses:none -javaagent:[/path/to/]xrebel-hub-agent.jar
  1. Press OK. When asked, save the master configuration and restart the server.

WebSphere Application Server Liberty Profile

To run XRebel, you need to specify the XRebel JVM argument in the JVM_ARGS environment variable before you launch the startup script:

  1. Run the JVM arguments setting command using the server command line:
  2. When using Mac OS or Linux:
export JVM_ARGS="-javaagent:[path/to]xrebel-hub-agent.jar"
  1. When using Windows:
set JVM_ARGS=-javaagent:[path/to]xrebel-hub-agent.jar
  1. Launch the server.

When you start your application server with this argument configured, the XRebel Hub agent is loaded at startup.


WildFly

WildFly on Windows

  1. Access your WildFly home folder.
  2. Open the bin folder.
  3. Add the following line at the end of standalone.conf.bat:
JAVA_OPTS=“-javaagent:[path/to/]xrebel-hub-agent.jar $JAVA_OPTS
  1. Save the file and start WildFly.

WildFly on Mac OS and Linux

  1. Access your WildFly home folder.
  2. Open the bin folder.
  3. Add the following line at the end of standalone.conf:
JAVA_OPTS=“-javaagent:[path/to/]xrebel-hub-agent.jar $JAVA_OPTS
  1. Save the file and start WildFly.