To enable the JRebel agent for the container that the application is deployed to, you need to add a -javaagent parameter to the JVM arguments list. For that you need to modify your server startup script as described in the manual.
The remote server support plugin is disabled by default. You need to add a JVM argument to activate it:
Dedicated port (optional)¶
When your application, deployed to a remote server does not have an HTTP endpoint (e.g. EJB modules and standalone applications), you can designate a port for remote server support to enable JRebel’s embedded Jetty container.
Adding -Drebel.remoting_port=[port number] (e.g. -Drebel.remoting_port=12345) enables the embedded Jetty container inside JRebel. This will be used for handling HTTP requests from the IDE plugin. Note that enabling Jetty will impact performance.
Server-side password configuration¶
To enable password-based security on the server, set the server password using the following command:
$ java -jar jrebel.jar -set-remote-password
To operate, JRebel remote server support requires a configuration file – rebel-remote.xml. This file is used to distinguish between the different application modules. The regular rebel.xml configuration file is ignored when the remote server support plugin is enabled. This file is automatically generated by the IDE and should never be edited manually.
<?xml version="1.0" encoding="UTF-8"?> <rebel-remote> <id>module-id</id> </rebel-remote>
The rebel-remote.xml configuration file should end up in your WEB-INF/classes directory in the case of a web module and in the root of the archive in the case of an EJB module or a JAR library. Put it in the root of a source or resource folder in your project (the same place where the .properties files are) and make sure it is copied to the target directory.
The configuration elements include:
- id is the only required element in rebel-remote.xml configuration file. This is the id of the application module, which will include this configuration. By module, we mean an individual JAR or a WAR file (web archive).
With the release of JRebel 6.2.4, a password-based security measure is included in remote server support with Eclipse. Future releases will roll out the new security protocol for other IDEs as well.
For more information, please refer to the specific IDE remote server chapters: