Servlet学习笔记(1)-热部署实现

首先,先假设您的MyEclipse和TomCat已安装完成,并配置成功,能运行显示出一个“Hello World!”。

默认情况下,运行Servlet,myeclipse会先关闭打开的服务,再打开服务,也就是重启。这很麻烦,很讨厌!所以,GG到了一个好东西~

i_jrebel_logo

它可以实现不用重启服务器,第一次启动之后,第二次就不用重启了,直接编译java文件,然后进入Servlet容器。。。

很好的功能,可惜它是收费的(30天试用),不过网上也有XX版的(XX不解释),现在看下它是怎么配置的:

下载JRebel

JRebel官网

XX版下载

配置

将Jar文件放在任意目录,然后在MyEclipse中,打开首选项(Preferences):

【MyEclipse】-【Servers】-【Tomcat】-【你用的版本】-【JDK】-【Option Java VM arguments:】-输入下列命令:

-noverify -javaagent:G:\software\编程开发\java\server\热部署\jrebel-3.5\jrebel_csdn\jrebel.jar -Xmx512M -Xms512M -XX:MaxPermSize=512m

红色部分为你的Jar文件路径,后面的参数,可以使JRebel运行更快速(有点像MyEclipse的启动优化),依你内存大小,适度调整。

然后,打开你的一个Servlet,点击工具栏的绿色按钮,开始启动服务,此时Console界面内会出现一大堆信息。包括JRebel的信息:

#############################################################

null Unknown (null)
(c) Copyright ZeroTurnaround OU, Estonia, Tartu.

 This product is licensed to cen
 for unlimited number of developer seats on site.

The following plugins are disabled at the moment:
* JBoss AOP Plugin (set -Drebel.jbossaop_plugin=true to enable)
Integration with jboss aop agent
* Jackson Plugin (set -Drebel.jackson_plugin=true to enable)
Supports reloading Jackson's JsonSerializer caches.
* Lift Plugin (set -Drebel.lift_plugin=true to enable)
Supports reloading singleton objects that extend LiftScreen or Wizard.
* Log4j plugin (set -Drebel.log4j-plugin=true to enable)
Reloads full configuration of log4j
* RESTEasy Plugin (set -Drebel.resteasy_plugin=true to enable)
Supports adding/changing methods with @Path annotation for RESTEasy application.
* Seam Wicket Plugin (set -Drebel.seam_wicket_plugin=true to enable)
Integration with load time weaving seam annotations to wicket classes
(-javaagent:<path-to-jboss-seam-wicket-jar>)
* WebObjects Plugin (set -Drebel.webobjects_plugin=true to enable)
WebObjects JRebel Plugin

#############################################################


null: A newer version '3.5' is available for download
null: from http://www.zeroturnaround.com/download.

可以发现这个版本的破解是由cen大xia干的~在此,感谢~

启动完毕,游览器内输入访问地址,成功访问后,修改代码,然后再次点击绿色按钮,只将编译java文件,而不是重启服务器。

大大减少了学习过程中干等服务器一上一下的的缓慢时间。

关于JRebel破解

http://www.blogjava.net/usherlight/archive/2009/10/15/298449.html

http://www.beansoft.biz/?p=310

posted @ 2011-01-13 14:29  小 .xin  阅读(954)  评论(0编辑  收藏  举报
回到页首