Wiki source code of Using DCEVM and Hotswap for rapid turnaround
Version 11.1 by Samuel Pelletier on 2015/07/07 17:42
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | DCEVM and Hotswap enable rapid turnaround by allowing almost any class change to the running VM. It offers an experience very similar to JRebel for WebObjects developers. With this tool, you usually do not have to restart your application after code change. | ||
2 | |||
3 | = Prerequisites = | ||
4 | |||
5 | * A JRE patched with the DCEVM | ||
6 | * (% style="line-height: 1.4285715;" %)The Hotwsap agent to handle the WebObjects caches. | ||
7 | |||
8 | === (% style="line-height: 1.4285715;" %)Patching the VM(%%) === | ||
9 | |||
10 | (% style="line-height: 1.4285715;" %)DCEVM is the patch that enable the enhanced class redefinition in the VM. Download the installer for your JRE version and install the alternative VM. The patch is not always available for the latest update of the JRE, you may try the latest update available but it may not works. At the time I write this, the patch for Java 1.8 update 45 is at build 15 and it does not works completely, I get exception because some DelegatingClassLoader are not updated. The version for Java 1.7 update 71 build 2 works fine with java 1.7.0_79. | ||
11 | |||
12 | DCEVM download site: **[[http:~~/~~/dcevm.github.io>>url:http://dcevm.github.io||shape="rect"]] ** | ||
13 | |||
14 | === (% style="line-height: 1.4285715;" %)Downloading the Hotswap agent(%%) === | ||
15 | |||
16 | (% style="line-height: 1.4285715;" %)Hotwsap agent allows plugins to react to class redefinition events. These plugins are similar to the the JRebel plugins and add frameworks specific code to make sure they handle correctly to the class changes. | ||
17 | |||
18 | (% style="line-height: 1.4285715;" %)Download the hot swap agent jar from my fork at [[https:~~/~~/github.com/spelletier/HotswapAgent/releases/tag/0.2_with_WO>>url:https://github.com/spelletier/HotswapAgent/releases/tag/0.2_with_WO||shape="rect"]] to an easy to type location, you will need the location to enable it. | ||
19 | |||
20 | === How to use in a project === | ||
21 | |||
22 | To enable HotSwap, add the following to the Run configuration of your project in the VM argument section: | ||
23 | |||
24 | -XXaltjvm=dcevm -javaagent:/replace_with_correct_path/hotswap-agent.jar | ||
25 | |||
26 | === Known limitations === | ||
27 | |||
28 | * Change of superclass is not supported by DCEVM. | ||
29 | * Modifying the return type of a method breaks. It seems there is some cache not cleared. | ||
30 | |||
31 | (% style="line-height: 1.4285715;" %) | ||
32 | |||
33 | |||
34 | (% style="line-height: 1.4285715;" %) |