链路追踪、服务监控集成不了,启动失败

Blade 未结 2 1784
sueiyan
sueiyan 剑童 2020-05-20 10:44

一、该问题的重现步骤是什么?

1. 链路追踪、服务监控,集成<artifactId>blade-starter-trace</artifactId>

2. 启动模块服务

3.报错:java.lang.IllegalStateException: Only one AsyncConfigurer may exist


二、你期待的结果是什么?实际看到的又是什么?

链路追踪成功          启动失败

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

BladeX — 2.4.0.RELEASE — 企业版,windows10

四、请提供详细的错误堆栈信息,这很重要。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.annotation.ProxyAsyncConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalStateException: Only one AsyncConfigurer may exist

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:382)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1404)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:392)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1320)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1159)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)

at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:228)

at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:721)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:534)

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:33)

at org.springblade.activity.ActivityApplication.main(ActivityApplication.java:13)

Caused by: java.lang.IllegalStateException: Only one AsyncConfigurer may exist

at org.springframework.scheduling.annotation.AbstractAsyncConfiguration.setConfigurers(AbstractAsyncConfiguration.java:74)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:710)

at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:376)

... 26 common frames omitted

五、若有更多详细信息,请在下面提供。

    <dependencies>

        <dependency>

            <groupId>org.springblade</groupId>

            <artifactId>blade-core-boot</artifactId>

        </dependency>

        <dependency>

            <groupId>org.springblade</groupId>

            <artifactId>blade-starter-trace</artifactId>

        </dependency>

        <dependency>

            <groupId>org.springblade</groupId>

            <artifactId>blade-activity-api</artifactId>

            <version>${blade.project.version}</version>

        </dependency>

        <dependency>

            <groupId>org.springblade</groupId>

            <artifactId>blade-core-test</artifactId>

            <scope>test</scope>

        </dependency>

    </dependencies>

2条回答
  • 按文档步骤操作下

    1_KG85UNOP37{[AZ5DVNOYQ.png

    作者追问:2020-05-20 10:57

    就是按照官方文档操作的,启动就报错,

    初步看是 引入blade-core-boot和blade-starter-trace,实现有冲突

    大概是 都实现了 AsyncConfigurer 接口


    0 讨论(0)
  • 2022-02-19 16:22

    我也遇到次问题,blade-auth添加链路blade-starter-trace依赖启动没有问题,其他的微服务就不可以,请问你是怎么处理的,给给思路借鉴一下

    0 讨论(0)
提交回复