首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Spring Boot 2.1缓存执行器不存在

Spring Boot 2.1缓存执行器不存在
EN

Stack Overflow用户
提问于 2018-11-25 22:51:40
回答 1查看 4K关注 0票数 3

我已经基于2.1版(https://github.com/dkellenb/spring-boot-2.1-cache-actuator-missing)设置了一个简单的spring启动应用程序。我找不到缓存执行器在http://localhost:8080/actuator/caches上不可用的原因。

代码语言:javascript
复制
@EnableCaching
@SpringBootApplication
@Controller
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
    @Cacheable(cacheNames = "helloWorld")
    @GetMapping
    public ResponseEntity<String> hello() {
        return ResponseEntity.ok("hello world");
    }
}

对于pom.xml,我添加了缓存和执行器:

代码语言:javascript
复制
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-cache</artifactId>
</dependency>

此外,我还测试了

代码语言:javascript
复制
endpoints.caches.enabled=true
management.endpoints.web.exposure.include=info,health,cache

请注意,缓存执行器可用于JMX,但在web上。

EN

回答 1

Stack Overflow用户

发布于 2019-06-10 00:48:29

我也遇到过类似的问题,原来执行器的版本必须是spring-boot-autoconfigure-2.1.3.RELEASE.jar。

我之前的版本是spring-boot-actuator-autoconfigure-2.0.2.RELEASE.jar.在此版本中,CachesEndpointAutoConfiguration不存在。如果应用程序中存在"cachesEndpoint“bean,则此类负责创建"cacheManager”bean。

尝试2.1.3版。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53468702

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档