idea 多项目部署JRebel
碰到个问题,Jrebel热部署Idea,两个项目一个可以热部署,一个不行。刚开始发现是其中一个项目没有添加JRebel,于是加上
然而发现还是不行,继续google,
在一篇文章里面发现如下的内容:
IntelliJ默认是不会自动编译项目的,所以在run之前会有个make的过程,习惯自动编译项目的可以在这里打开:Compiler=>make project automatically。因为IntelliJ项目空间不大,所以开启之后也不会像Eclipse一样出现build workspace很久的情况。
JRebel部署后会有一个 rebel.xml的文件,打开里面的内容
<?xml version="1.0" encoding="UTF-8"?> <!-- This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project. Refer to https://manuals.zeroturnaround.com/jrebel/standalone/config.html for more information. --> <application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd"> <classpath> <dir name="F:/workspace/vip/zm-vip-service/target/classes"> </dir> </classpath> <web> <link target="/"> <dir name="F:/workspace/vip/zm-vip-service/src/main/webapp"> </dir> </link> </web> </application>
一个是class编译的目录,一个是java目录。而idea是不会自动编译的,因此问题找到。。。
但是还是奇怪,为什么一个可以,一个不可以。因为两个项目的idea的设置是相同的。想到这里,把项目重新rebuild了下。结果竟然都可以了。。。
每次如果有 JRebel reloading。。。 是正常的
3.设置idea自动编译
4.启动 jRebel后重启时候
错误: 代理抛出异常错误: java.rmi.server.ExportException: Port already in use: 1007; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
解决办法:找到占用的1007端口,关闭
netstat -aon|findstr 1007
taskkill -f -pid +进程号