JavaRebel是一个工具,主要是用于热加载,比如说在Tomcat之类的应用服务器中,更新了class或者某些资源文件,使用了JRebel之后,就不需要重新启动应用服务器。这里有一点先声明一下,本文只是破解仅限于学习和研究使用,勿用于其他用途。
下载地址:http://www.zeroturnaround.com/jrebel/download/ 下载下来的是一个Zip压缩包,打开之后会发现一个jrebel.jar,这就是其最重要的运行包了。其他都是一些文档和插件。
PS. rebel出了免费社区版,参见:
http://zeroturnaround.com/blog/free-version-of-jrebel-social/
一、安装包准备
1. Jrebel.jar 核心JAR包,http://zeroturnaround.com/jrebel/prev-releases/ 上面进行下载。
安装 JRebel Eclipse插件进入 Help » Install New Software... 并且输入下面的URL :http://www.zeroturnaround.com/update-site/
2. update-site.zip jrebel Eclipse插件http://www.zeroturnaround.com/update-site/update-site.zip
二、配置Eclipse
(1)、Eclipse中配置 window->preference->tomcat->JVM Settings,加入以下参数
-Drebel.spring_plugin=true 支持spring框架
-Drebel.aspectj_plugin=true 支持aspectj
-Drebel.struts2_plugin=true 支持strut2
-javaagent:D:/jrebel.jar 这里自行修改jrebel.jar正确的路径
-Drebel.dirs=F:/Project/test/WebContent/WEB-INF/classes,F:/Project/test/WebContent
-Dmyproject.root=D:/project/operamasks/workspaces/xxxx -Drebel.disable_update=true
-noverify
[(-javaagent 下载的jrebel.jar的路径,-Drebel.dirsc 项目的class文件的路径, -Dmyproject.root的值表示当前的需要热部署的工程路径)]
- JRebel: Starting logging to file: C:\Users\Administrator\.jrebel\jrebel.log
- 2015-03-18 23:27:34 JRebel:
- 2015-03-18 23:27:34 JRebel: #############################################################
- 2015-03-18 23:27:34 JRebel:
- 2015-03-18 23:27:34 JRebel: JRebel Legacy Agent 6.1.1 (201503111717)
- 2015-03-18 23:27:34 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu.
- 2015-03-18 23:27:35 JRebel:
- 2015-03-18 23:27:35 JRebel: Over the last 1 days JRebel prevented
- 2015-03-18 23:27:35 JRebel: at least 0 redeploys/restarts saving you about 0 hours.
- 2015-03-18 23:27:35 JRebel:
- 2015-03-18 23:27:35 JRebel: Licensed to wei huang
- 2015-03-18 23:27:35 JRebel:
- 2015-03-18 23:27:35 JRebel: License type: evaluation
- 2015-03-18 23:27:35 JRebel: Valid from: March 18, 2015
- 2015-03-18 23:27:35 JRebel: Valid until: April 1, 2015
- 2015-03-18 23:27:35 JRebel:
- 2015-03-18 23:27:35 JRebel: You are using an EVALUATION license.
- 2015-03-18 23:27:35 JRebel: Days left until license expires: 14
- 2015-03-18 23:27:35 JRebel:
- 2015-03-18 23:27:35 JRebel: To extend your evaluation or purchase a license,
- 2015-03-18 23:27:35 JRebel: contact sales@zeroturnaround.com.
- 2015-03-18 23:27:35 JRebel:
- 2015-03-18 23:27:35 JRebel: If you think this is an error, contact support@zeroturnaround.com.
- 2015-03-18 23:27:35 JRebel:
- 2015-03-18 23:27:35 JRebel:
- 2015-03-18 23:27:35 JRebel: #############################################################
- 2015-03-18 23:27:35 JRebel:
- 2015-03-18 23:27:35 JRebel: WARN
- 2015-03-18 23:27:35 JRebel: WARN You have multiple 'D:\software\eclipse\eclipse-jee-kepler-SR2-win32-x86_64\eclipse\plugins\org.zeroturnaround.eclipse.embedder_6.1.1.RELEASE-201503121801\jrebel\jrebel.jar's as -javaagent in your server startup script
- 2015-03-18 23:27:35 JRebel: WARN
- 三月 18, 2015 11:27:36 下午 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: C:\Program Files\Java\jdk1.7.0_55\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files (x86)\Common Files\NetSarang;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0_55\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Git\cmd;D:\software\apache-maven-3.0.5/bin;C:\Program Files\MySQL\MySQL Server 5.1\bin;.
- 三月 18, 2015 11:27:36 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
- 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:tv_mobile' did not find a matching property.
- 三月 18, 2015 11:27:36 下午 org.apache.coyote.AbstractProtocol init
- 信息: Initializing ProtocolHandler ["http-bio-8080"]
- 三月 18, 2015 11:27:36 下午 org.apache.coyote.AbstractProtocol init
- 信息: Initializing ProtocolHandler ["ajp-bio-8009"]
- 三月 18, 2015 11:27:36 下午 org.apache.catalina.startup.Catalina load
- 信息: Initialization processed in 1057 ms
- 三月 18, 2015 11:27:36 下午 org.apache.catalina.core.StandardService startInternal
- 信息: Starting service Catalina
- 三月 18, 2015 11:27:36 下午 org.apache.catalina.core.StandardEngine startInternal
- 信息: Starting Servlet Engine: Apache Tomcat/7.0.53
- 2015-03-18 23:27:39 JRebel: Directory 'D:\software\eclipse\workspace2\tv_mobile\target\classes' will be monitored for changes.
- 2015-03-18 23:27:39 JRebel: Directory 'D:\software\eclipse\workspace2\tv_mobile\target\m2e-wtp\web-resources' will be monitored for changes.
- 2015-03-18 23:27:39 JRebel: Directory 'D:\software\eclipse\workspace2\tv_mobile\src\main\webapp' will be monitored for changes.
- 三月 18, 2015 11:27:45 下午 org.apache.catalina.core.ApplicationContext log
- 信息: No Spring WebApplicationInitializer types detected on classpath
- 2015-03-18 23:27:45 JRebel-Log4j: Monitoring Log4j configuration in 'file:/D:/software/eclipse/workspace2/tv_mobile/target/classes/log4j.properties'.
- 三月 18, 2015 11:27:45 下午 org.apache.catalina.core.ApplicationContext log
- 信息: Initializing Spring root WebApplicationContext
- 2015-03-18 23:27:45 JRebel-Spring: Monitoring Spring bean definitions in 'D:\software\eclipse\workspace2\tv_mobile\target\classes\beans.xml'.
- 2015-03-18 23:27:48 JRebel-Spring: Monitoring properties in 'D:\software\eclipse\workspace2\tv_mobile\target\classes\jdbc.properties'.
- 初始化字典
- Hibernate:
- /* criteria query */ select
- this_.id as id1_5_0_,
- this_.description as descript2_5_0_,
- this_.groupId as groupId3_5_0_,
- this_.key2 as key4_5_0_,
- this_.value as value5_5_0_
- from
- t_dictionary this_
- order by
- this_.groupId asc,
- this_.key2 asc
- 三月 18, 2015 11:27:57 下午 org.apache.catalina.core.ApplicationContext log
- 信息: Initializing Spring FrameworkServlet 'spring2'
- 2015-03-18 23:27:57 JRebel-Spring: Monitoring Spring bean definitions in 'D:\software\eclipse\workspace2\tv_mobile\target\m2e-wtp\web-resources\WEB-INF\spring2-servlet.xml'.
- 三月 18, 2015 11:27:58 下午 org.apache.coyote.AbstractProtocol start
- 信息: Starting ProtocolHandler ["http-bio-8080"]
- 三月 18, 2015 11:27:58 下午 org.apache.coyote.AbstractProtocol start
- 信息: Starting ProtocolHandler ["ajp-bio-8009"]
- 三月 18, 2015 11:27:58 下午 org.apache.catalina.startup.Catalina start
- 信息: Server startup in 21843 ms
JRebel: Starting logging to file: C:\Users\Administrator\.jrebel\jrebel.log 2015-03-18 23:27:34 JRebel: 2015-03-18 23:27:34 JRebel: ############################################################# 2015-03-18 23:27:34 JRebel: 2015-03-18 23:27:34 JRebel: JRebel Legacy Agent 6.1.1 (201503111717) 2015-03-18 23:27:34 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu. 2015-03-18 23:27:35 JRebel: 2015-03-18 23:27:35 JRebel: Over the last 1 days JRebel prevented 2015-03-18 23:27:35 JRebel: at least 0 redeploys/restarts saving you about 0 hours. 2015-03-18 23:27:35 JRebel: 2015-03-18 23:27:35 JRebel: Licensed to wei huang 2015-03-18 23:27:35 JRebel: 2015-03-18 23:27:35 JRebel: License type: evaluation 2015-03-18 23:27:35 JRebel: Valid from: March 18, 2015 2015-03-18 23:27:35 JRebel: Valid until: April 1, 2015 2015-03-18 23:27:35 JRebel: 2015-03-18 23:27:35 JRebel: You are using an EVALUATION license. 2015-03-18 23:27:35 JRebel: Days left until license expires: 14 2015-03-18 23:27:35 JRebel: 2015-03-18 23:27:35 JRebel: To extend your evaluation or purchase a license, 2015-03-18 23:27:35 JRebel: contact sales@zeroturnaround.com. 2015-03-18 23:27:35 JRebel: 2015-03-18 23:27:35 JRebel: If you think this is an error, contact support@zeroturnaround.com. 2015-03-18 23:27:35 JRebel: 2015-03-18 23:27:35 JRebel: 2015-03-18 23:27:35 JRebel: ############################################################# 2015-03-18 23:27:35 JRebel: 2015-03-18 23:27:35 JRebel: WARN 2015-03-18 23:27:35 JRebel: WARN You have multiple 'D:\software\eclipse\eclipse-jee-kepler-SR2-win32-x86_64\eclipse\plugins\org.zeroturnaround.eclipse.embedder_6.1.1.RELEASE-201503121801\jrebel\jrebel.jar's as -javaagent in your server startup script 2015-03-18 23:27:35 JRebel: WARN 三月 18, 2015 11:27:36 下午 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: C:\Program Files\Java\jdk1.7.0_55\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files (x86)\Common Files\NetSarang;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0_55\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Git\cmd;D:\software\apache-maven-3.0.5/bin;C:\Program Files\MySQL\MySQL Server 5.1\bin;. 三月 18, 2015 11:27:36 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:tv_mobile' did not find a matching property. 三月 18, 2015 11:27:36 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-bio-8080"] 三月 18, 2015 11:27:36 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-bio-8009"] 三月 18, 2015 11:27:36 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 1057 ms 三月 18, 2015 11:27:36 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 三月 18, 2015 11:27:36 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.53 2015-03-18 23:27:39 JRebel: Directory 'D:\software\eclipse\workspace2\tv_mobile\target\classes' will be monitored for changes. 2015-03-18 23:27:39 JRebel: Directory 'D:\software\eclipse\workspace2\tv_mobile\target\m2e-wtp\web-resources' will be monitored for changes. 2015-03-18 23:27:39 JRebel: Directory 'D:\software\eclipse\workspace2\tv_mobile\src\main\webapp' will be monitored for changes. 三月 18, 2015 11:27:45 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 2015-03-18 23:27:45 JRebel-Log4j: Monitoring Log4j configuration in 'file:/D:/software/eclipse/workspace2/tv_mobile/target/classes/log4j.properties'. 三月 18, 2015 11:27:45 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 2015-03-18 23:27:45 JRebel-Spring: Monitoring Spring bean definitions in 'D:\software\eclipse\workspace2\tv_mobile\target\classes\beans.xml'. 2015-03-18 23:27:48 JRebel-Spring: Monitoring properties in 'D:\software\eclipse\workspace2\tv_mobile\target\classes\jdbc.properties'. 初始化字典 Hibernate: /* criteria query */ select this_.id as id1_5_0_, this_.description as descript2_5_0_, this_.groupId as groupId3_5_0_, this_.key2 as key4_5_0_, this_.value as value5_5_0_ from t_dictionary this_ order by this_.groupId asc, this_.key2 asc 三月 18, 2015 11:27:57 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'spring2' 2015-03-18 23:27:57 JRebel-Spring: Monitoring Spring bean definitions in 'D:\software\eclipse\workspace2\tv_mobile\target\m2e-wtp\web-resources\WEB-INF\spring2-servlet.xml'. 三月 18, 2015 11:27:58 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] 三月 18, 2015 11:27:58 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-bio-8009"] 三月 18, 2015 11:27:58 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 21843 ms
此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/70421.html