JRebel remote server support in Eclipse

This chapter lists the steps required to set up JRebel remote server support for Eclipse. You need a working, activated JRebel installation in your IDE. Please follow the instructions on how to install and configure JRebel for Eclipse. If you have already set up JRebel, move on to step 1.


1. Enable JRebel remote server support on the server

Running JRebel on a remote server requires the JRebel agent jrebel.jar and a special launch parameter. Follow these steps to do this.

  1. Download the standalone JRebel archive here and extract jrebel.jar from it. Upload jrebel.jar to the remote server and make a note of its location.

    Note

    The JRebel ZIP archive contains two jrebel.jar files:

    • JRebel Legacy Agent is located in the root folder.
    • JRebel 6 Agent is located in the lib folder.

    When in doubt, use the JRebel Legacy Agent. For more information, please refer to Switching between JRebel Agents.

  2. Add -javaagent:/path/to/jrebel.jar attribute to the server startup parameters. This guarantees that JRebel is started with the server.

  3. Add the -Drebel.remoting_plugin=true attribute to the server startup parameters.

Here is an example of a server startup script with both jrebel.jar and remote server feature enabled:

-javaagent:/path/to/jrebel.jar -Drebel.remoting_plugin=true

Enabling password authentication

To enable JRebel password authentication on the server, use the -set-remote-password <NewPassword> CLI command. Doing this will require all connecting JRebel IDE plugins to be configured with the same password for successful synchronization.

Note

Use the following parameter to remove the password from the server: java -jar jrebel.jar -disable-remote-password


How do I know this works?

Once you have successfully configured JRebel remote server support for your remote server, you should see the following banner during remote server startup:

2016-09-14 12:01:38 JRebel:  #####################################################
2016-09-14 12:01:38 JRebel:
2016-09-14 12:01:38 JRebel:  JRebel Legacy Agent 6.5.0 (201609121236)
2016-09-14 12:01:38 JRebel:  (c) Copyright ZeroTurnaround AS, Estonia, Tartu.
2016-09-14 12:01:38 JRebel:
2016-09-14 12:01:38 JRebel:  Over the last 1 days JRebel prevented
2016-09-14 12:01:38 JRebel:  at least 1 redeploys/restarts saving you
2016-09-14 12:01:38 JRebel:  about 0 hours.
2016-09-14 12:01:38 JRebel:
2016-09-14 12:01:38 JRebel:  Server is running with JRebel remote server support.
2016-09-14 12:01:38 JRebel:
2016-09-14 12:01:38 JRebel:  #####################################################

2. Add a workspace server

  1. Open Help > JRebel > Configuration. Select the Remote servers tab. You will be presented with the following view:

    ../_images/eclipse-remoteservers-jrebel.png
  2. Press Add server. The following dialog will open:

    ../_images/eclipse-remoteservers-addnew-jrebel.png

    Provide the remote server information:

    • Server name – Provide a name for the remote server.
    • Server URL – Provide the full URL for the server. This field is required.

    You can expand the Security settings section to enforce stricter server security:

    • Server authentication – Enable additional synchronization security. Specify a simple alphanumeric password. The password also needs to be set on the server: java -jar jrebel.jar -set-remote-password <NewPassword>.
    • HTTP Basic authentication – Enable HTTP authentication when your remote server requires it.

    Tip

    Press Test connection to immediately test the server URL. This test will ping the server for JRebel, verifying its presence and correct version.

  3. Press Save to store the new remote server.

This server can now be used by all projects in your workspace. Any new servers added from this view are automatically enabled for workspace synchronization. To disable a workspace server, deselect the checkbox in front of the server name.


3. Configure projects for remote server support

  1. Open Help > JRebel > Configuration. Select the Projects tab. The following table will open:

    ../_images/eclipse-jrebel-config-center-enable-nature1.png
  2. Select the jrcloudicon checkbox for your project.

    Note

    The configuration file rebel-remote.xml is created in the project resources folder.

  3. Build and redeploy your application containing the rebel-remote.xml configuration file to the remote server.

  4. You are set!

Tip

By default, all configured projects inherit the workspace server settings.

To configure your workspace projects for a customized remote server setup, press the pencil icon next to the project name. The project properties window is opened for remote servers. The following options are available:

  • Off – No remote server synchronization functionality is applied to the project.
  • Use all active workspace servers – Once remote servers have been defined and enabled via Help > JRebel > Configuration > Remote servers, all of them will be used for synchronization of this project. This option provides a simpler configuration when working with just one remote server or when the project is deployed to all remote servers. You can use the global Remote servers view to enable/disable servers for all projects configured with this option.
  • Select specific workspace servers for this project – Select or deselect remote servers in the table to enable them for the project. This project will be synchronized only with the selected servers. Note that enabling or disabling remote servers in the global Remote servers view has no effect on projects using this configuration.

As of JRebel 6.4.8, any previous project-specific settings will be automatically converted to configurable workspace servers.


4. Synchronize with the server

Use the syncbutton synchronization button on the toolbar to manually synchronize all configured projects between your workstation and server. To synchronize a single project, open the drop-down menu next to the button and select the desired project.

You can also right-click the desired project node in the Project Explorer and select JRebel > Synchronize from the context menu to synchronize. Your synchronization status is displayed in the console log.