2

The deployment we follow is that we use runAssembler.bat to build an ear file and deploy it in a app server. We are using weblogic and jboss for testing purposes of the modules we built. However for every small change, we need to run runAssembler and build a new ear and deploy it in app server and restart the server.

I would like to find out if anyone figured out a way to do Hotswapping of class files which are generated by the code we write in ATG environment in either weblogic or jboss.

Buddha
  • 4,339
  • 2
  • 27
  • 51

3 Answers3

2

By attaching your IDE to your Application server on the Debug port it is generally possible to do hotswapping. Setting this up on Eclipse and JBoss is documented here, here and here. There is some information for setting it up in WebLogic here.

Attach your debugger, edit the java file, click 'save' and with hot code replacement in your IDE it should now update the running class file. In Eclipse it usually gives a popup if it was unable to do the sync. If you are using Eclipse, make sure the 'Build Automatically' flag under projects is ticked or you'll be waiting forever. I've not had any issues doing this via JBOSS (exploded ATG EAR) and variable success in doing this on WebSphere 7. It may also be prudent to make sure the same JAVAC you use to compile your build is the one loaded into your IDE compile path.

Another way to at least reduce the build/deploy time would be to deploy an unpacked/exploded EAR and simply copy your class files across (you could use the Eclipse FileSync plugin) and restart the server.

There are also some commercial options available, like JRebel

Community
  • 1
  • 1
radimpe
  • 3,197
  • 2
  • 27
  • 46
  • I'm failing to understand how to extend remote debugging concept to hotswapping. I have done remote debugging of ATG modules before, but never extended it to do hotswapping. I can't use JRebel, because certain organisational issues. – Buddha Jan 02 '14 at 09:39
  • Attach your debugger, edit the java file, click 'save' and with `hot code replacement` in your IDE it should now update the running class file. In Eclipse it usually gives a popup if it was unable to do the sync. If you are using Eclipse, make sure the 'Build Automatically' flag under projects is ticked or you'll be waiting forever. I've not had any issues doing this via JBOSS (exploded ATG EAR) and variable success in doing this on WebSphere 7. It may also be prudent to make sure the same `JAVAC` you use to compile your build is the one loaded into your IDE compile path. – radimpe Jan 02 '14 at 11:06
  • I feel this explanation complements the answer very well. Hence I have added. Either approve the edit I made or you can do the necessary change. In any case, I accept your answer, thanks. – Buddha Jan 02 '14 at 11:13
2

In our organization, we had good success in using DCEVM. It simply patches your JDK (in Windows: jvm.dll).

  1. Download and patch your JDK
  2. Launch your JBoss/Weblogic with the patched JDK
  3. Set up Eclipse's Installed JRE's to point to patched JDK (restart and rebuild once)
  4. Start the server, Launch debugger and connect
  5. Ensure Eclipse's Debug view shows "Dynamic Code Evolution VM" (instead of something like "HotSpot VM")
  6. Change your code, and voila!
KrishPrabakar
  • 2,824
  • 2
  • 31
  • 44
  • Yes, this is what we have been using for sometime... not completely, but fulfills our need to some extent. – Buddha Mar 01 '15 at 10:22
  • 2
    If you also need custom support for special frameworks like Spring, use HotSwap Agent: http://www.hotswapagent.org/quick-start – KrishPrabakar Mar 02 '15 at 11:20
  • And this is supposed to work without HotSwap Agent? – Mike Jul 31 '19 at 23:35
  • @Mike DCEVM can work without Hotswap Agent as well. For pure Java applications, DCEVM is enough, only when you use frameworks like Spring, Log4j, etc, Hotswap Agent is needed. – KrishPrabakar Nov 19 '19 at 06:44
0

You can do this with JRebel. After hotswapping you don't need to restart the server, only reload you deployment from Weblogic.

George
  • 125
  • 2
  • 8
  • Thanks for the answer, but we can't use JRebel at the moment. – Buddha Jan 02 '14 at 09:44
  • There is also [DCEVM](http://ssw.jku.at/dcevm/), but I have not used it, to see how it works or how to integrate with ATG. – George Jan 02 '14 at 10:30