简体   繁体   English

...factory.UnsatisfiedDependencyException 实际上是“org.springframework.cloud.sleuth.instrument.messaging.LazyTopicConnectionFactory”类型

[英]...factory.UnsatisfiedDependencyException actually of type 'org.springframework.cloud.sleuth.instrument.messaging.LazyTopicConnectionFactory'

So I've been trying to find out solution to this from long !所以我一直在努力寻找解决这个问题的方法! Any insights would help !任何见解都会有所帮助!

I am getting following error我收到以下错误

org.springframework.beans.factory.UnsatisfiedDependencyException: 

Error creating bean with name 

'routerConnectionFactory' defined in class path resource 

[com/CONFIDENTIAL/event/processor/configuration/EventsConfiguration.class]: Unsatisfied dependency expressed through method 'routerConnectionFactory' parameter 0; nested exception is 

org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 

'actionRouterConnectionFactory' is expected to be of type 'org.apache.activemq.ActiveMQConnectionFactory' but

 was actually of type 'org.springframework.cloud.sleuth.instrument.messaging.LazyTopicConnectionFactory'

Code snippet代码片段

 @Bean(name = "routerConnectionFactory")
    @Primary
    public CachingConnectionFactory routerConnectionFactory(ActiveMQConnectionFactory actionRouterConnectionFactory ){
        CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
        cachingConnectionFactory.setTargetConnectionFactory(actionRouterConnectionFactory);
        return  cachingConnectionFactory;

    }

    @Bean
    public ActiveMQConnectionFactory actionRouterConnectionFactory(
            @Value("${confidential.gateway.message.broker.url}") String brokerURL,
            @Value("${confidential.router.message.broker.user.name}") String userName,
            @Value("${confidential.router.message.broker.user.password}") String password,
            @Value("true") Boolean alwaysSyncSend, RedeliveryPolicy defaultEntry,
            @Value("${shared.amq.keystore.path:#{null}}") String keyStorePath,
            @Value("${shared.amq.keystore.password:#{null}}") String keyStorePassword) throws Exception {
        ActiveMQSslConnectionFactory targetConnectionFactory= new ActiveMQSslConnectionFactory();
        targetConnectionFactory.setBrokerURL(brokerURL);
        targetConnectionFactory.setUserName(userName);
        targetConnectionFactory.setPassword(password);
        if(!StringUtils.isEmpty(keyStorePath) && !StringUtils.isEmpty(keyStorePassword)){
            targetConnectionFactory.setTrustStore(keyStorePath);
            targetConnectionFactory.setTrustStorePassword(keyStorePassword);
        }
        targetConnectionFactory.setAlwaysSyncSend(alwaysSyncSend);
        targetConnectionFactory.setRedeliveryPolicy(defaultEntry);
        return targetConnectionFactory;
    }


spring-cloud-sleuth-core : 2.2.6.RELEASE
spring-cloud-sleuth-zipkin : 2.2.6.RELEASE
active-mq-broker, active-mq-camel, client, jms-pool , open-wire-legacy, pool, spring : 5.15.13
other spring boot and related dependencies : 2.2.6.RELEASE

https://edwin.baculsoft.com/2019/07/error-overriding-bean-of-same-name-declared-in-class-path-resource-when-integrating-spring-cloud-sleuth-and-activemq-library/ https://edwin.baculsoft.com/2019/07/error-overriding-bean-of-same-name-declared-in-class-path-resource-when-integrating-spring-cloud-sleuth-and-activemq-图书馆/

Referred multiple articles on this issue (also on StackoverFlow), also tried disabling sleuth but didn't help !参考了有关此问题的多篇文章(也在 StackoverFlow 上),还尝试禁用 sleuth 但没有帮助!

Any clue ?有什么线索吗?

Your method signatures are looking for 'ActiveMQConnectionFactory'-- that is tightly coupled to ActiveMQ.您的方法签名正在寻找与 ActiveMQ 紧密耦合的“ActiveMQConnectionFactory”。 Most likely, the intetion is to couple to JMS API instead.最有可能的是,意图是耦合到 JMS API。 Change code to use javax.jms.ConnectionFactory instead.更改代码以改用 javax.jms.ConnectionFactory。 (ActiveMQConnectionFactory implements javax.jms.ConnectionFactory) (ActiveMQConnectionFactory 实现 javax.jms.ConnectionFactory)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 org.springframework.beans.factory.UnsatisfiedDependencyException问题: - Issue with org.springframework.beans.factory.UnsatisfiedDependencyException: org.springframework.beans.factory.UnsatisfiedDependencyException moskito - org.springframework.beans.factory.UnsatisfiedDependencyException moskito 与 unsatisfiedDependencyException org.springframework.beans.factory 的问题 - issue with unsatisfiedDependencyException org.springframework.beans.factory org.springframework.beans.factory.UnsatisfiedDependencyException-是错误 - org.springframework.beans.factory.UnsatisfiedDependencyException - is the Error 异常org.springframework.beans.factory.UnsatisfiedDependencyException - Exception org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factory.UnsatisfiedDependencyException 1 - org.springframework.beans.factory.UnsatisfiedDependencyException 1 SpringBoot org.springframework.beans.factory.UnsatisfiedDependencyException - SpringBoot org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factory.UnsatisfiedDependencyException Springboot - org.springframework.beans.factory.UnsatisfiedDependencyException Springboot Spring 4-自动装配问题:org.springframework.beans.factory.UnsatisfiedDependencyException:没有合格的类型的bean - Spring 4 - Autowiring Issue: org.springframework.beans.factory.UnsatisfiedDependencyException: No qualifying bean of type Spring Boot:org.springframework.beans.factory.UnsatisfiedDependencyException - Spring Boot:org.springframework.beans.factory.UnsatisfiedDependencyException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM