Is it possible to do Hotswapping of ATG classes

落爺英雄遲暮 提交于 2019-12-14 04:16:26

问题


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.


回答1:


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




回答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!



回答3:


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



来源:https://stackoverflow.com/questions/20861543/is-it-possible-to-do-hotswapping-of-atg-classes

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