Jrebel 的配置及使用(实现WEB应用的热部署)

1. 配置tomcat服务器:修改tomcat的部署配置为:从不自动发布,禁用Web模块的自动从新装入为:禁用
2. 在tomcat运行配置上添加vm参数:-noverify -javaagent:D:\RUNTIME\jrebel\jrebel.jar -Dmyproject.root=D:/project/operamasks/workspaces/xxxx -Drebel.disable_update=true
   其中:-javaagent的值表示jrebel的jar包路径
   -Dmyproject.root的值表示当前的需要热部署的工程路径
3. 在工程的src源文件夹下添加名称为:rebel.xml的配置文件,内容格式如下:

 

Xml代码 复制代码  收藏代码
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">  
  3.     <classpath>  
  4.         <dir name="${myproject.root}/bin">  
  5.         </dir>  
  6.         <dir name="${myproject.root}/web/WebContent/WEB-INF/classes">  
  7.         </dir>  
  8.     </classpath>  
  9.     <web>  
  10.         <link target="/">  
  11.             <dir name="${myproject.root}/web/WebContent">  
  12.             </dir>  
  13.         </link>  
  14.     </web>  
  15. </application>  

 

 

其中:myproject.root就是tomcat vm参数中指定的工程路径,你也可以使用绝对路径
这个文件定义的就是jrebel要监控的具体文件夹,即class文件和资源文件(比如:jsp等)


4.最后,启动tomcat服务器的成功提示:

 

Fri Oct 19 10:34:29 CST 2012 com.zeroturnaround.javarebel.hD#new V( false )
Fri Oct 19 10:34:29 CST 2012 com.zeroturnaround.javarebel.bH#public boolean a(byte abyte0[])

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

 JRebel 3.0-M1 (200910151623)
 (c) Copyright ZeroTurnaround, Ltd, 2007-2009. All rights reserved.

 A rough estimate: Over the last 5 days JRebel
 prevented the need for at least 36 redeploys/restarts.
 Using industry standard build and redeploy times,
 JRebel saved you between 1 and 2 hours.

 This product is licensed to  Java Hack Organization
 for unlimited number of developer seats on site.

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值