1. 双击Eclipse中的Server 在打开的配置画面的Overview Tab页中点击【open launch configuration】,然后在弹出画面的【VM arguments】中加入
JVM参数
-javaagent: D:\java\driver\JRebel4.0.1\jrebel.jar -- 你存放jrebel.jar的位置 (任意)
-Dmyproject.root=D:/java/project/xxx -- 你项目工程位置
-noverify
-Drebel.spring_plugin=true
-Drebel.ibatis_plugin=true -- 改Ibatis配置文件将不用重启服务器,JRebel 会自动 Reloading sql maps.
-Drebel.log=false
-Drebel.disable_update=true
-Drebel.workspace.path=D:\java\project
-Drebel.metadata.path=D:\java\project\.metadata\.jrebel
使用目录下的jrebel.jar 蓝色的为可选参数,可以不加
使用目录下的jrebel4.jar(注意,改名成jrebel.jar后再使用)
1. 必须把rebel.xml放到项目的SRC目录
2. 必须把Eclipse Server配置页面中的发布选项改为【不自动发布】
3. Eclipse->Project->Build Automatically 必须勾上
4. myproject.root指定到Eclipse中相应项目的目录,该变量被rebel.xml使用(JRebel4.0通过监控rebel.xml中指定的目录来自动重载变更过的java,jsp文件)
jrebel3.1才开始支持ibatis
3.6才支持使用spring template的ibaits
具体-D后面的参数名称,可以参考jar包中相应plugin包中的相应插件类:如IbatisPlugin
getId()方法返回的就是设置的参数
<?xml version="1.0" encoding="UTF-8"?> <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"> <classpath> <dir name="${myproject.root}/build/classes"> </dir> </classpath> <web> <link target="/"> <dir name="${myproject.root}/WebContent"> </dir> </link> </web> </application>
改Tomcat的配置文件server.xml中的
<Context docBase="xxx" path="/xxx" reloadable="false" source="org.eclipse.jst.jee.server:mmt"/></Host>
另: tomcat溢出解决办法
双击Eclipse中的Server 在打开的配置画面的Overview Tab页中点击【open launch configuration】,然后在弹出画面的【VM arguments】中加入
-Xms256m
-Xmx256m
-XX:MaxNewSize=256m
-XX:MaxPermSize=256m
修改Timeouts的参数 Start :120 Stop :15