Unable to wire TopicConnectionFactory Beans, since they get wrapped by LazyConnectionFactory
See original GitHub issueDear Spring Cloud Team,
Since Version 2.1.0
the class TracingConnectionFactoryBeanPostProcessor
wraps any javax.jms.ConnectionFactory
into a LazyConnectionFactory
.
This creates an issue when autowiring beans of type javax.jms.TopicConnectionFactory
, since any TopicConnectionFactory
gets wrapped in a LazyConnectionFactory
(Check LazyConnectionFactory:78).
But since the LazyConnectionFactory
is not assignable to TopicConnectionFactory
the following exception is thrown during the wiring process:
Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'activeMqConnectionFactory' is expected to be of type 'javax.jms.TopicConnectionFactory' but was actually of type 'org.springframework.cloud.sleuth.instrument.messaging.LazyConnectionFactory'
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1257)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1167)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760)
... 51 common frames omitted```
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:20 (6 by maintainers)
Top Results From Across the Web
BeanNotOfRequiredTypeExcepti...
The LazyConnectionFactory simply wraps your connection factory (in it's delagate property), but it doesn't provide access to the delegate. If ...
Read more >spring-cloud/spring-cloud-sleuth - Gitter
Does the ConnectionFactory get created as a bean? ... Yeah, though I think there must be one since I don't believe the wrapping...
Read more >Unable to connect TopicConnectionFactory to host,Client ID ...
Hi, I am facing an issue with my java application which is trying to connect with the server via jms. The application tries...
Read more >javax.jms.XAConnectionFactory Java Examples
Tests if preparing a DTX branch after setting fail flag in dtx.end throws an ... Wrap the caching connection factories instead of its...
Read more >IT25917: A MQ-Java/JMS application fails to connect to ... - IBM
APAR status. Closed as program error. Error description. An IBM MQ classes for JMS application is attempting to connect to a queue manager...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Problem is solved in the latest snapshot build.