开发者社区> 问答> 正文

springboot2.0 后内存数据库与actuator不能同时使用?报错

springboot2.0 后内存数据库H2与actuator不能同时使用

报datasource循环依赖,可有遇到的帮忙看下是啥问题,怎么解决,只要把两个包放进maven启动就报错

he dependencies of some of the beans in the application context form a cycle:

   servletEndpointRegistrar defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.class]
      ↓
   healthEndpoint defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]
      ↓
   org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration
┌─────┐
|  dataSource
↑     ↓
|  scopedTarget.dataSource defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]
↑     ↓
|  org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker
└─────┘

展开
收起
爱吃鱼的程序员 2020-06-06 16:16:23 760 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <p>你试下启动时指定参数 --spring.cloud.refresh.refreshable=none</p>
    
                    
    
                        <p>使用springboot 2.0.4,这应该是个bug,springcloud官方修复了</p>
    
                    
    
                        <div class='ref'><h4>引用来自“gcl大胖子”的评论</h4><p>使用springboot 2.0.4,这应该是个bug,springcloud官方修复了</p>
    
    
                        <p>按各位大神所说的方法更改后为什么报这个错误呢</p> 
    

    java.lang.AbstractMethodError: null
        at org.springframework.core.OrderComparator.findOrder(OrderComparator.java:142) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE]
        at org.springframework.core.annotation.AnnotationAwareOrderComparator.findOrder(AnnotationAwareOrderComparator.java:65) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE]
        at org.springframework.core.OrderComparator.getOrder(OrderComparator.java:125) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE]
        at org.springframework.core.OrderComparator.getOrder(OrderComparator.java:113) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE]
        at org.springframework.core.OrderComparator.doCompare(OrderComparator.java:82) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE]
        at org.springframework.core.OrderComparator.compare(OrderComparator.java:68) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE]
        at java.util.TimSort.countRunAndMakeAscending(TimSort.java:360) ~[na:1.8.0_111]
        at java.util.TimSort.sort(TimSort.java:220) ~[na:1.8.0_111]
        at java.util.Arrays.sort(Arrays.java:1512) ~[na:1.8.0_111]
        at java.util.ArrayList.sort(ArrayList.java:1454) ~[na:1.8.0_111]
        at org.springframework.boot.SpringApplication.asUnmodifiableOrderedSet(SpringApplication.java:1325) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
        at org.springframework.boot.SpringApplication.getListeners(SpringApplication.java:1234) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
        at org.springframework.boot.context.event.EventPublishingRunListener.contextLoaded(EventPublishingRunListener.java:85) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
        at org.springframework.boot.SpringApplicationRunListeners.contextLoaded(SpringApplicationRunListeners.java:66) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
        at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:394) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:328) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
        at com.daihou.EurekaServer.main(EurekaServer.java:14) [classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
        at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.0.4.RELEASE.jar:2.0.4.RELEASE]

    2020-06-06 16:16:33
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
DTCC 2022大会集锦《云原生一站式数据库技术与实践》 立即下载
阿里云瑶池数据库精要2022版 立即下载
2022 DTCC-阿里云一站式数据库上云最佳实践 立即下载