ehcache關於做屬性查詢的時候啓動報錯:
先解析一下報錯原因,根據報錯信息基本可以排查出是查詢屬性不支持磁盤。
ehcache本身是不支持從磁盤緩存屬性查找。
所以,查看配置
<cache name="jzspCache" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="false"> <searchable> <searchAttribute name="kssj"/> <searchAttribute name="jssj"/> </searchable> </cache>
overflowToDisk屬性設置爲false即可,代表着緩存不往磁盤中寫。