[Spring] Exception is thrown complaining about multiple matching beans with version 1.2.5
See original GitHub issueIn the process of transitioning from version Cucumber 1.1.8 to 1.2.5 I have ran into an issue where the below exception is thrown:
CucumberException No qualifying bean of type x is defined: expected single matching bean but found 2
I tried to dig a bit deeper and I see that the <T> T getInstance(final Class<T> type)
method in SpringFactory
class had changed and apparently is somehow responsible for that behavior.
I was able to replicate this behavior in a simple project which I uploaded to github and the link is below.
Cucumber Version: 1.2.5 Operating System and version: Windows 7 Link to your project: https://github.com/EugeneS30/cucumber-bean-defect-verification.git
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
[Spring] Exception is thrown complaining about multiple ...
It appears to be that CoffeeSteps twice is registered twice. Once because it has the @ContextHierarchy/@ContextConfiguration annotation and once ...
Read more >Cannot find the declaration of element 'beans' - Stack Overflow
the xml validator is complaining that <beans> is not a valid element. This validates in an external xml site. can you open springframework.org/schema/beans/ ......
Read more >Spring Framework Reference Documentation
It is possible to accidentally mix different versions of Spring JARs when ... an IllegalStateException will be thrown complaining about an unknown bean...
Read more >Spring BeanCreationException - Baeldung
A quick and practical guide to dealing with different causes of Spring BeanCreationException.
Read more >The Spring Framework - Reference Documentation
The Spring Framework continues to be compatible with all versions of Java since (and ... This could happen if the bean throws an...
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 FreeTop 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
Top GitHub Comments
@EugeneS30 possibly. You’d have to put a break poing at
DefaultListableBeanFactory#registerBeanDefinition
and see which beans are registered and where they came from.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.