xitrum-framework / xitrum

Async and clustered Scala web framework and HTTP(S) server
http://xitrum-framework.github.io/
MIT License
446 stars 52 forks source link

[Autoreload in dev mode] Replace classloaders with DCEVM #434

Closed ngocdaothanh closed 10 years ago

ngocdaothanh commented 10 years ago

Why: Currently, throwaway class loaders are used. This method is limited and it leads to many issues, like #423. The issues reverse the benefits of the autoreload feature itself.

How:

http://javainformed.blogspot.jp/2014/01/jrebel-free-alternative.html http://dcevm.nentjes.com/ http://ssw.jku.at/dcevm/ https://github.com/dcevm/dcevm https://github.com/HotswapProjects/HotswapAgent (http://www.hotswapagent.org/)


You can use standard Java Hotswap from IDE in debug mode to reload changed class or set autoHotswap property -XXaltjvm=dcevm -javaagent:PATH_TO_AGENT\hotswap-agent.jar=autoHotswap=true to reload changed classes after compilation. This setup allows even reload on production system without restart.

dcevm/j2re-macos64/bin/java -javaagent:hotswap-agent.jar=autoHotswap=true <MainClass>
ngocdaothanh commented 10 years ago

Agent7 now works OK. I've added it to xitrum-new skeleton branch 3.17.

I'll add DCEVM installation guide to the Xitrum Guide. Xitrum 3.17 will be released very soon.

ngocdaothanh commented 10 years ago

Fixed Xitrum Guide: https://github.com/xitrum-framework/xitrum-doc/issues/99