Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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!

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top