小编Мих*_*тов的帖子

如何启用 Ehcache 3.x JSR-107 MBean 操作?

为什么以下 ehcache.xml 不允许通过 JMX 清除缓存(在 JVisualVM for MBean 中禁用“操作”选项卡进行缓存管理并启用缓存统计)?我使用 spring boot 框架并通过 spring.cache.jcache.config 属性指定 ehcache.xml 文件位置,然后仅使用 @Cachable spring 框架注释。

<config
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns='http://www.ehcache.org/v3'
    xmlns:jsr107='http://www.ehcache.org/v3/jsr107'
    xsi:schemaLocation="
        http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.0.xsd
        http://www.ehcache.org/v3/jsr107 http://www.ehcache.org/schema/ehcache-107-ext-3.0.xsd">


  <service>
    <jsr107:defaults enable-management="true" enable-statistics="true"/> 
  </service>

  <cache alias="stringCache"> 
    <key-type>java.lang.String</key-type>
    <value-type>java.lang.String</value-type>
    <heap unit="entries">2000</heap>
  </cache>

</config>
Run Code Online (Sandbox Code Playgroud)

java jmx ehcache spring-boot

0
推荐指数
1
解决办法
1627
查看次数

标签 统计

ehcache ×1

java ×1

jmx ×1

spring-boot ×1