ERROR - Error reading /oscache.properties in CacheAdministrator.loadProps() java.lang.NullPointerException
ERROR - Ensure the /oscache.properties file is readable and in your classpath.
导入包,修改好数据库连接,oscache.properties这个文件找不到了,报了这个错啊!一般这个文件怎么丢失了呢?怎么把它找回来?

解决方案 »

  1.   

     oscache.properties  osCache的配置文件   放在 webapp/WEB-INF/classes/下;    oscache.properties 中的配置项如下:    1、cache.memory:       原文:          Valid values are true or false, with true being the default value. If you want to disable memory caching,          just comment out or remove this line.          Note: disabling memory AND disk caching is possible but fairly stupid       译文:          是否使用内存缓存; true 或 false。默认为true;          个人推荐内存方法,在速度会有些优势;    2、cache.capacity       原文:           The maximum number of items that a cache will hold. By default the capacity is unlimited - the cache will never remove any items.           Negative values will also be treated as meaning unlimited capacity.       译文:          缓存的最大数量。默认是不限制,cache不会移走任何缓存内容。负数被视不限制。    3、cache.algorithm       原文:           The default cache algorithm to use. Note that in order to use an algorithm the cache size must also be specified.           If the cache size is not specified, the cache algorithm will be Unlimited cache regardless of the value of this property. If you specify a size but not an algorithm, the cache algorithm used will be com.opensymphony.oscache.base.algorithm.LRUCache.           OSCache currently comes with three algorithms:                 * com.opensymphony.oscache.base.algorithm.LRUCache - Least Recently Used.                  This is the default when a cache.capacity is set.                 * com.opensymphony.oscache.base.algorithm.FIFOCache - First In First Out.                 * com.opensymphony.oscache.base.algorithm.UnlimitedCache - Content that is added to the cache will never be discarded.                  This is the default when no value is set for the cache.capacity property.       译文:           运算规则。为了使用规则,cache的size必须是指定的。           如果cache的size不指定的话, 将不会限制缓存对象的大小。如果指定了cache的size,但不指定algorithm,           那它会默认使用:com.opensymphony.oscache.base.algorithm.LRUCache           有下面三种规则:               * com.opensymphony.oscache.base.algorithm.LRUCache       : last in first out(最后插入的最先调用)。默认选项。               * com.opensymphony.oscache.base.algorithm.FIFOCache      : first int first out(最先插入的最先调用)。               * com.opensymphony.oscache.base.algorithm.UnlimitedCache : cache中的内容将永远不会被丢弃。               如果cache.capacity不指定值的话,它将被设为默认选项。
      

  2.   

    直接把oscache.properties 拷贝到SRC下不行吗??
      

  3.   

    oscache.properties  
    osCache的配置文件  
    从src或etc目录取得oscache. properties 文件,放入src根目录或发布环境的/WEB-INF/classes 目录
    就可以了
      

  4.   

    谁能把oscache.properties这个文件内容贴下,我现在找不到这个文件
      

  5.   

    里面内容:
    cache.memory=true
    cache.capacity=1000
    我也打个记号……