zoukankan      html  css  js  c++  java
  • Tomcat7 + JRebel6.3.0 + IntelliJ idea 热部署配置过程+错误分析

    以前使用Tomcat的时候直接就可以热部署,现在换了一个使用Spring框架的项目突然就不能热部署了。

    网上说在tomcat里conf/context.xml中加入

    <Context antiJARLocking="true" antiResourceLocking="true" >

    就可以实现热部署,但修改后依然不行。

    倒腾了半天听说可以使用JRebel可以实现功能,于是在IntelliJ的插件里找来。

    按照网上的教程配置好之后,我找到web项目部署的位置xxitaxPlatformoutartifactsitaxPlatform_Web_exploded,我发现里面的文件更新日期是随着每次我改动代码而变化的,这说明IntelliJ部署的web项目是被更新的。

    奇怪的是运行起来却发现代码并没有更新。

    莫非此刻在Tomcat服务器中运行的Java代码并不是IntelliJ部署的web项目代码?

    我想一定是另有一份代码在我所不知道的角落悄悄运行着。

    我在打印出的日志中找到这么一句

    JRebel: Monitoring Log4j configuration in 'file:/D:/software/apache-tomcat-7.0.64-windows-x64/apache-tomcat-7.0.64/temp/0-admin/WEB-INF/classes/log4j.properties'.

    我意识到Tomcat也许运行了一个temp的项目。

    再上网找,有网友也遇到类似问题,把antiJARLocking="true" antiResourceLocking="true" 去掉就好,因为这会让Tomcat复制一份文件到temp文件夹中。

    原来是这样。

    去掉之后,JRebel贴心地弹了一个提示框告诉你,第一次热部署成功。

  • 相关阅读:
    C++学习笔记27,虚函数作品
    HDU
    POJ 2524 Ubiquitous Religions
    HDU-3839-Ancient Messages(DFS)
    thinkphp 删除所有缓存 Rumtime 以及 Html 静态缓存
    [AngularJS] Design Pattern: Simple Mediator
    [Javascript] Add a browser build to an npm module
    [Angular 2] ngrx/store
    [Typescript] Introduction to Generics in Typescript
    [AngularJS] angular-md-table for Angular material design
  • 原文地址:https://www.cnblogs.com/andrew-chen/p/5057338.html
Copyright © 2011-2022 走看看