consider increasing the maximum size of the cache

解决办法在tomcat下面的conf/conext.xml中加入如下配置

<!-- 设置最大缓存量 -->默认的是:The maximum size of the static resource cache in kilobytes. If not specified, the default value is 10240 (10 megabytes). This value may be changed while the web application is running (e.g. via JMX). If the cache is using more memory than the new limit the cache will attempt to reduce in size over time to meet the new limit. If necessary, cacheObjectMaxSize will be reduced to ensure that it is no larger than cacheMaxSize/20.

详情:http://tomcat.apache/tomcat-8.0-doc/config/resources.html

tomcat--》conf--》context.xml文件——》在resource标签中加上


<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
    <Resources cachingAllowed="true" cacheMaxSize="100000" />
</Context>

切记:由于本地运行eclipse有工作空间workspace,需要把工作空间里面的context.xml修改下。服务器没有工作空间。

最近的项目需要修改 context.xml 文件,可是每次重启Tomcat,context 文件又还原了。

例如环境如下:

Tomcat 安装路径:D:\apache\apache-tomcat-7.0.56\

Eclipse工作空间:D:\Develop\workspace\

相关项目:TestProject

需要的操作:

1. 在Eclipse工作空间server 目录下查找tomcat 下面的context.xml 。我的路径是D:\Develop\workspace\Servers\Tomcat v7.0 Server at localhost-config 。下面有 context.xml,修改此文件

2. 删除Tomcat 目录下server中catalina的相关项目。我的路径是D:\apache\apache-tomcat-7.0.56\work\Catalina\localhost\ 。将TestProject删除即可。

下次重启Tomcat 时,此项目就使用新的context.xml 文件了。
 

更多推荐

控制台提示缓存不够,consider increasing the maximum size of the cache