tomcat的热部署和热加载
2016-07-01 22:07
513 查看
最近接触的项目在tomcat启动时特别慢,启动将近花十分钟,在开发的过程中,出现一个java文件修正,tomcat就重新启动一次,实在无法忍受,上网查了一下tomcat的热部署和热加载,才知道是由于【reloadable="true"】导致的。
下面是关于reloadable的解释,如果【/WEB-INF/classes/】或者/WEB-INF/lib 下面有变化,tomcat会重新加载整个web应用。
reloadable:Set to
recommended for use on deployed production applications. That's why the default setting for this attribute is
false. You can use the
Manager web application, however, to trigger reloads of deployed applications on demand.
下面是关于autoDeploy的解释,当context XML改变的时候,会直接部署到tomcat上,而不用重启tomcat。假设tomcat下面多加了一个应用,tomcat会自动部署这个应用,不用重新启动。
autoDeploy:This flag value indicates if Tomcat should check periodically for new or updated web applications while Tomcat is running. If true, Tomcat periodically checks the
See
Automatic Application Deployment for more information.
以上都是自己的理解,有不足或者错误请指出,谢谢!
参考资料:
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
http://tomcat.apache.org/tomcat-7.0-doc/config/host.html
下面是关于reloadable的解释,如果【/WEB-INF/classes/】或者/WEB-INF/lib 下面有变化,tomcat会重新加载整个web应用。
reloadable:Set to
trueif you want Catalina to monitor classes in
/WEB-INF/classes/and
/WEB-INF/libfor changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not
recommended for use on deployed production applications. That's why the default setting for this attribute is
false. You can use the
Manager web application, however, to trigger reloads of deployed applications on demand.
下面是关于autoDeploy的解释,当context XML改变的时候,会直接部署到tomcat上,而不用重启tomcat。假设tomcat下面多加了一个应用,tomcat会自动部署这个应用,不用重新启动。
autoDeploy:This flag value indicates if Tomcat should check periodically for new or updated web applications while Tomcat is running. If true, Tomcat periodically checks the
appBaseand
xmlBasedirectories and deploys any new web applications or context XML descriptors found. Updated web applications or context XML descriptors will trigger a reload of the web application. The flag's value defaults to true.
See
Automatic Application Deployment for more information.
以上都是自己的理解,有不足或者错误请指出,谢谢!
参考资料:
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
http://tomcat.apache.org/tomcat-7.0-doc/config/host.html
相关文章推荐
- Tomcat虚拟目录设置
- Liferay 中部署portlet的细节窥探
- 图解利用Auto Deploy 部署ESXi 5.x参考v1.0
- eclipse部署web项目至本地的tomcat但在webapps中找不到
- 【Tomcat】eclipse如何安装tomcat插件
- 使用CSDN-CODE&C-IDE搭建tomcat环境
- Tomcat中server.xml配置及Context的配置直接引用工程
- tomcat7.0中外置的Context配置
- Tomcat配置虚拟路径,使上传文件与服务器及工程文件分离
- tomcat运行报错java.lang.UnsatisfiedLinkError: Can load AMD 64
- 在tomcat下运行java代码
- tomcat UTF-8格式的HTML文件乱码
- 安装 tomcat
- maven自动部署tomcat7
- apache与tomcat整合(一)
- 如何设置Tomcat的JVM虚拟机内存大
- Linux下JDK、Tomcat的安装及配置
- Jetty与tomcat的比较
- myeclipse 启动tomcat时报错: java.lang.NullPointerException java.lang.NullPointerException
- Cannot change deployment state from ERROR to REDEPLOYING.ds