无法将cacheDecorator添加到ehcache [英] Unable to add cacheDecorator to ehcache

查看:159
本文介绍了无法将cacheDecorator添加到ehcache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用提前在线刷新,如下所述: http://terracotta.org/documentation/4.1/bigmemorymax/api/refresh-ahead#scheduled-refresh-ahead

Using "Inline Refresh Ahead" as described at : http://terracotta.org/documentation/4.1/bigmemorymax/api/refresh-ahead#scheduled-refresh-ahead

我将缓存条目更新为:

   <?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
    <defaultCache eternal="true" maxElementsInMemory="100"
        overflowToDisk="false" />
    <cache name="myCache" maxElementsInMemory="10000" eternal="true"
        overflowToDisk="false">

        <cacheDecorator
            class="net.sf.ehcache.constructs.refreshahead.RefreshAheadCacheFactory"
            properties="name=myCacheRefresher,
      timeToRefreshSeconds=200,
      batchSize=10,
      numberOfThreads=4,
      maximumBacklogItems=100,
      evictOnLoadMiss=true" />

    </cache>
</ehcache>

但是我收到错误消息:

Element不允许嵌套元素。

Element does not allow nested elements.

所以看来我添加了不正确的cacheDecorator吗?

So it seems that I have added the cacheDecorator incorrectly ?

推荐答案

如果您查看文档(请参阅@ alain.janinm的评论)和 XSD 它说

If you look in the documentation (cf. @alain.janinm's comment) and the XSD it says

....
<xs:element name="cache">
    <xs:complexType>
        <xs:sequence>
            ...
            <xs:element minOccurs="0" maxOccurs="unbounded"
                        ref="cacheDecoratorFactory"/>
                                           ^^^^^^^

因此,您的问题是错字-更改

So, your problem is a typo - change

<cacheDecorator class="net.sf.ehcache....

<cacheDecoratorFactory class="net.sf.ehcache....

您会没事的。

干杯,

这篇关于无法将cacheDecorator添加到ehcache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆