Thursday, May 2, 2013

Hot deploy in R1

ADF Release 1 of jdeveloper has limited support for hot deploying java code.  When running the integrated Weblogic server in debug mode, JSPX/JSFF files will hot deploy as soon as you save and reload the page.    You are also allowed to make changes to java methods as long as you don't change the structure of the class.  This means you can't add or remove methods, change method signatures or add or remove class properties or static members but you can change the code inside a method and instantly deploy the change while the server is running.   To do this hit CTRL+SHFT+F9 key combination.   This will compile and deploy the single java class that has been changed.   If it is successful you will see the message
"Redefined all recompiled classes that are loaded in the debuggee process.” 

 For a long time I had been using CTRL+F9 which performs a full build and hot deploy of the application.   Our application is very large and this would take over a minute to complete but  CTRL+SHFT+F9  will hot deploy a single file in about 1 second.  I don't know why this key combination is not front and center on the build menu (since CTRL+F9 is).   It is listed in the context menu that displays when you right click on a Page. (see image)  but I never noticed that the "Make" on the context menu was different than the "Make" on the Build menu so didn't pay attention to the hot keys listed.    It is a huge time saver but the only way to learn that this is a "single file" make command is to browse the Tools Menu (Preferences/Shortcut Keys) to find it.   CTRL+SHFT+F9  is now my most favorite keystroke.

Release 2 has much betters support for hot deploy.  I'm not using release 2 yet but here is blog that describes What works and what doesn't.