Is it possible to do Hotswapping of ATG classes

半世苍凉 提交于 2019-12-04 15:31:58
radimpe

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!