question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Spring] Exception is thrown complaining about multiple matching beans with version 1.2.5

See original GitHub issue

In 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:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mpkorstanjecommented, Sep 20, 2017

@EugeneS30 possibly. You’d have to put a break poing at DefaultListableBeanFactory#registerBeanDefinition and see which beans are registered and where they came from.

0reactions
lock[bot]commented, Oct 24, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found