Eclipse3.7+Jetty 热部署

1、Jrebel介绍:

   我们通常做WEB开发的时候经常会修改java类,或者是工程配置文件,而每次修改后都需要将服务器重新启动,才能显示修改后的效果,而有些服务器 像 weblogic ,jboss 启动的时候非常慢,频繁的启动浪费了大量的时间,降低了开发效率。

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Jrebel(JavaRebel) 可以帮助解决频繁的重新启动服务器的问题,从而为开发节约了大量的时间。

Jrebel是一个JVM插件(-javaagent),能够即时重载java <?xml:namespace prefix = st1 ns = "Tencent" /><rtx w:st="on">cl</rtx>ass更改,因此不需要重新部署一个应用或者重启容器,节约开发者时间。它是一个Java EEJava 独立应用的常用解决方案。

 

Jrebel可以和MyE<rtx w:st="on">cl</rtx>ipse,tomcat等快速的组装在一起,用语动态部署java文件而不用重启服务器,从而可解决大量的开发时间,提高开发效率。

只要配置了Jrebel,它可以监控你的编译文件存放目录,例如:APP_INF/<rtx w:st="on">cl</rtx>asses 或者 WEB-INF/<rtx w:st="on">cl</rtx>asses

然后在客户端发送页面请求时,关联到该类时,它会自动比较当前JVM中装载的该类是否有修改,如果有则重新装载该类文件。

 

2 、Jrebel使用介绍

 

下面以Jrebel + E<rtx w:st="on">cl</rtx>ipseJrebel+Jetty为例,介绍Jrebel的在项目开发,部署环境的搭建即使用。

配置方法:

 

 


2bb2a3b2-5a17-37d8-b097-71ae54c1cb36.jpg
 

 


f5015d79-4a03-3e0a-9084-284c0cf422c4.png
 

 
fea3b900-6a1f-3b95-ade9-d5279901b362.png
 

 


769d24ee-c570-338b-a326-d9da0087cbb1.png
 

 


ed94acc8-8790-3504-ac68-222ab304e0fe.png
 

 


1920ff80-c80d-329e-9935-b51c8c6a2532.png
 

 


babd2454-1d43-3b60-a562-f2c5c401d410.png
 

 

3、jetty的目录下找到etc目录下的webdefault.xml文件,只要把找到useFileMappedBuffer参数,把值设成fa<rtx w:st="on">ls</rtx>e。结果如下:

<init-param>

    <param-name>useFileMappedBuffer</param-name>

    <param-value>fa<rtx w:st="on">ls</rtx>e</param-value>

</init-param>

这样就完成了,重启Jetty,以后修改java文件就不需要重新启动了。

 

 

如果你看到服务器控制台上有如下或相似的提示,那么恭喜你成功了!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

JRebel: Please rename 'jrebel<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">4.0.2</chsdate>.jar' to 'jrebel.jar'

JRebel: or add '-Xboot<rtx w:st="on">cl</rtx>asspath/a:D:\so<rtx w:st="on">ft</rtx>\jrebel\jrebel<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">4.0.2</chsdate>.jar' to the command line!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

 

 

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

 

 JRebel <chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">4.0.2</chsdate> (<rtx w:st="on">2011</rtx>06<rtx w:st="on">2112</rtx>06)

   with <place w:st="on"><city w:st="on">Enterprise</city></place> Add-On! (see http://jrebel.com/enterprise)

 (c) Copyright ZeroTurnaround OU, <country-region w:st="on">Estonia</country-region>, <city w:st="on"><place w:st="on">Tartu</place></city>.

 

 Over the last 1 days JRebel prevented

 at least 0 redeploys/restarts saving you about 0 hours.

 

 This product is licensed to Unlimited

 For FUN! Unlimited! Enjoy!

 

 The following plugins are disabled at the moment:

 * <rtx w:st="on">Cl</rtx>ick plugin (set -Drebel.<rtx w:st="on">cl</rtx>ick_plugin=true to enable)

Reloads menu.xml menu definitions of Apa<rtx w:st="on">ch</rtx>e <rtx w:st="on">Cl</rtx>ick projects.

 * <rtx w:st="on">Gl</rtx>assfish METRO plugin (set -Drebel.metro_plugin=true to enable)

Supports METRO JAX-WS <chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">2.2.3</chsdate> implementation of the JAX-WS standard

 * JBoss AOP plugin (set -Drebel.jbossaop_plugin=true to enable)

Integration with jboss aop agent

 * <city w:st="on"><place w:st="on">Jackson</place></city> plugin (set -Drebel.jackson_plugin=true to enable)

Supports reloading <place w:st="on"><city w:st="on">Jackson</city></place>'s <rtx w:st="on">Js</rtx>onSerializer ca<rtx w:st="on">ch</rtx>es.

 * Li<rtx w:st="on">ft</rtx> plugin (set -Drebel.li<rtx w:st="on">ft</rtx>_plugin=true to enable)

Supports reloading sin<rtx w:st="on">gl</rtx>eton objects that extend RestHelper, MV<rtx w:st="on">CH</rtx>elper,

Li<rtx w:st="on">ft</rtx>Screen or Wizard.

 * RESTEasy plugin (set -Drebel.resteasy_plugin=true to enable)

Supports adding/<rtx w:st="on">ch</rtx>anging 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 <rtx w:st="on">cl</rtx>asses

(-javaagent:<path-to-jboss-seam-wicket-jar>)

 * WebObjects plugin (set -Drebel.webobjects_plugin=true to enable)

WebObjects JRebel Plugin

 

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

 

 

 

JRebel: Directory 'D:\workspace_helios\pmz\web\WEB-INF\<rtx w:st="on">cl</rtx>asses' will be monitored for <rtx w:st="on">cl</rtx>ass <rtx w:st="on">ch</rtx>anges.

 

 

看到上面标绿色的打出日志信息!

 

 

 

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值