?
? ?? ? 所谓java web 程序的热部署,就是在不重启tomcat的前提下,对class jsp 进行修改,系统会自动将编译后的内容刷新到tomcat web 容器中,刷新浏览器,就可以查看修改后的状态。
????? 这样做的好处很明显,它可以节省因为修改代码而频繁发布,重启web容器的时间,毕竟在开发中对代码的修改次数是很频繁的,如果项目比较大,发布也是一个很耗时的事情。
????? jrebel 实现了与eclipse的整合,方便了系统热部署的实现,当然这也需要付出一些代价,由于jrebel需要监控class的修改,所以会对eclipse的运行速度有些影响,不过现在的很普通的笔记本的硬件还是支撑的起的。
???? 下面给出实现步骤:
???? 1)安装jrebel 插件
????????? eclipse3.7 打开help》install new sofware 在弹出窗口中添加
?????? ?? http://update.zeroturnaround.com/update-site?
?????????
?
?
2)?? 在http://zeroturnaround.com/software/jrebel/download/#headline 右下角填写信息
????
?
?
???? 注册获得license
????
?
? 粘贴保存
3)网速快的话,eclipse 已经安装好了jrebel 。安装成功会提示重启eclipse,重启后会出现如下页面
? ??
?
?? 将保存的license 复制到红圈的方框里? ,右下角出现
??
?
?? 说明jrebel 已经激活
?
4)配置jrebel configure 文件
???? 在eclipse右侧视图栏中打开jrebel
????
?
???? 首先在overview中 照着红圈去配置
????
?
?
??? 5)添加服务 并配置相关属性
??????
?
??????? 双击红色区域的server 弹出如下窗口
??????
?
?
6)启动服务 出现如下信息 及为成功
?? [2013-03-21 00:10:12]
[2013-03-21 00:10:12] #############################################################
[2013-03-21 00:10:12]
[2013-03-21 00:10:12]? JRebel 5.2.0 (201302272115)
[2013-03-21 00:10:12]? (c) Copyright ZeroTurnaround OU, Estonia, Tartu.
[2013-03-21 00:10:12]
[2013-03-21 00:10:12]? Over the last 1 days JRebel prevented
[2013-03-21 00:10:12]? at least 8 redeploys/restarts saving you about 0 hours.
[2013-03-21 00:10:12]
[2013-03-21 00:10:12]? You are running with an evaluation license.
[2013-03-21 00:10:12]? You have 14 days until the license expires.
[2013-03-21 00:10:12]
[2013-03-21 00:10:12]? You will see this notification until you obtain a
[2013-03-21 00:10:12]? full license for your installation.
[2013-03-21 00:10:12]
[2013-03-21 00:10:12]? Visit www.jrebel.com for instructions on obtaining???
[2013-03-21 00:10:12]? a full license. If you wish to continue your evaluation?
[2013-03-21 00:10:12]? please e-mail to support@zeroturnaround.com.????????????
[2013-03-21 00:10:12]??????????????????????????????????????????????????????????
[2013-03-21 00:10:12]? If you think you should not see this message contact????
[2013-03-21 00:10:12]? support@zeroturnaround.com or check that you have your??
[2013-03-21 00:10:12]? license file in the same directory as the JAR file.?????
[2013-03-21 00:10:12]
[2013-03-21 00:10:12]? The following plugins are disabled at the moment:
[2013-03-21 00:10:12]? * Camel plugin (set -Drebel.camel_plugin=true to enable)
[2013-03-21 00:10:12]? * Click plugin (set -Drebel.click_plugin=true to enable)
[2013-03-21 00:10:12]? * JRuby Plugin (set -Drebel.jruby_plugin=true to enable)
[2013-03-21 00:10:12]? * Jersey plugin (set -Drebel.jersey_plugin=true to enable)
[2013-03-21 00:10:12]? * Log4j2 plugin (set -Drebel.log4j2-plugin=true to enable)
[2013-03-21 00:10:12]? * Mustache Plugin (set -Drebel.mustache_plugin=true to enable)
[2013-03-21 00:10:12]? * Oracle ADF Core plugin (set -Drebel.adf_core_plugin=true to enable)
[2013-03-21 00:10:12]? * Oracle ADF Faces plugin (set -Drebel.adf_faces_plugin=true to enable)
[2013-03-21 00:10:12]? * RESTlet plugin (set -Drebel.restlet_plugin=true to enable)
[2013-03-21 00:10:12]? * Seam-Wicket plugin (set -Drebel.seam_wicket_plugin=true to enable)
[2013-03-21 00:10:12]? * Spring Data Plugin (set -Drebel.spring_data_plugin=true to enable)
[2013-03-21 00:10:12]? * Thymeleaf Plugin (set -Drebel.thymeleaf_plugin=true to enable)
[2013-03-21 00:10:12]? * WebObjects plugin (set -Drebel.webobjects_plugin=true to enable)
[2013-03-21 00:10:12]
[2013-03-21 00:10:12] #############################################################
[2013-03-21 00:10:12]
2013-3-21 0:10:13 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\Java\jdk1.6.0_24\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\Program Files\Java\jdk1.6.0_24\jre\bin;D:/Program Files/Java/jre6/bin/client;D:/Program Files/Java/jre6/bin;D:/Program Files/Java/jre6/lib/i386;D:\Oracle\instantclient_11_2\bin;D:\Oracle\instantclient_11_2;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\Broadcom\WHL\;C:\Program Files\Common Files\Lenovo;C:\Program Files\Windows Live\Shared;C:\SWTOOLS\ReadyApps;C:\Program Files\Intel\Services\IPT\;C:\Program Files\Symantec\VIP Access Client\;D:\Program Files\Java\jdk1.6.0_24\bin;D:\Program Files\apache-tomcat-6.0.30\bin;D:\Program Files\apache-tomcat-6.0.30\lib\servlet-api.jar;C:\mysql_psasp\binD:\Program Files\TortoiseSVN\bin;D:\Oracle\instantclient_11_2;D:\Program Files\apache-maven-3.0.5\bin;F:\tools\eclipse-jee-indigo-SR2-win32\eclipse;
2013-3-21 0:10:13 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:psucp' did not find a matching property.
2013-3-21 0:10:13 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2013-3-21 0:10:13 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 431 ms
2013-3-21 0:10:13 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2013-3-21 0:10:13 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.30
[2013-03-21 00:10:13] JRebel: Directory 'F:\eclipse_workspace\psucp\target\classes' will be monitored for changes.
[2013-03-21 00:10:13] JRebel: Directory 'F:\eclipse_workspace\psucp\src\main\webapp' will be monitored for changes.
2013-3-21 0:10:13 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(F:\eclipse_workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\psucp\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2013-3-21 0:10:14 org.apache.catalina.core.ApplicationContext log
信息: Set web app root system property: 'com.psasp.psucp' = [F:\eclipse_workspace\psucp\src\main\webapp\]
2013-3-21 0:10:14 org.apache.catalina.core.ApplicationContext log
信息: Initializing log4j from [F:\eclipse_workspace\psucp\src\main\webapp\WEB-INF\log4j.properties]
[2013-03-21 00:10:14] JRebel-Log4j: Monitoring Log4j configuration in 'file:/F:/eclipse_workspace/psucp/src/main/webapp/WEB-INF/log4j.properties'.
2013-3-21 0:10:14 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
?
7)自己边debug 边爽吧
?
?
?
?
?
?
?
?