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
└─────┘
<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]
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。