Search attributes not supported by this store type: net.sf.ehcache.store.disk.DiskStore

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即可,代表着緩存不往磁盤中寫。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章