-
Notifications
You must be signed in to change notification settings - Fork 41.2k
FailureAnalyzer for NoSuchBeanDefinitionException #6612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Completely agree Rohit, we spent 2-3 hours just finding and annotating beans during a migration effort. This feature enhancement would help fortune 500 companies |
I wonder if we could use the auto-configuration report to find beans that would have matched and to describe why they weren't available. |
Absolutely. Most of the time the beans exist but are not candidates for injection due to various filter. We basically need to look at all the candidate beans for an injection that were filtered and report on those. |
Reusing the auto-configuration report is brilliant but we'll have to update it a bit to make that work (or live with the limitation). The biggest problem I can see right now is that if we have several methods with the same name and different arguments only one entry is recorded for them all. The culprit is in Granted, several I am working on a prototype ignoring those limitations for now, we can certainly revisit that once we have something in place. |
I've requested an improvement in Spring Framework to be able to handle cases where a qualifier was required. |
This commit adds a `FailureAnalyzer` that handles the case where the context does not start because no candidate bean was found for an `InjectionPoint`. The implementation inspects the auto-configuration report for beans that are candidate and output the condition(s) that lead to such beans to be discarded on startup. If a whole auto-configuration class is disabled (or excluded), its beans are inspected and candidates are extracted in a similar way. This works for both injection by type and by name. See spring-projectsgh-6612
I actually created something like this in my project as well. I think the https://www.reddit.com/r/programming/comments/3izji8/longest_stacktrace_i_have_ever_seen_in_java/ |
This commit adds a `FailureAnalyzer` that handles the case where the context does not start because no candidate bean was found for an `InjectionPoint`. The implementation inspects the auto-configuration report for beans that are candidate and output the condition(s) that lead to such beans to be discarded on startup. If a whole auto-configuration class is disabled (or excluded), its beans are inspected and candidates are extracted in a similar way. This works for both injection by type and by name. See spring-projectsgh-6612
This commit adds a `FailureAnalyzer` that handles the case where the context does not start because no candidate bean was found for an `InjectionPoint`. The implementation inspects the auto-configuration report for beans that are candidate and output the condition(s) that lead to such beans to be discarded on startup. If a whole auto-configuration class is disabled (or excluded), its beans are inspected and candidates are extracted in a similar way. This works for both injection by type and by name. See spring-projectsgh-6612
Uh oh!
There was an error while loading. Please reload this page.
One of the most common startup failures for Spring Applications is the
org.springframework.beans.factory.NoSuchBeanDefinitionException
.There are multiple causes for this exception ranging from Spring Beans not annotated correctly to the incorrect spring profile being in effect.
A failure analyzer that analyzes and introspects the classpath to suggest possible candidates for injection when this exception is thrown will considerably improve the debugging and onramp of application developers with the spring frameowork.
The NoSuchBeanDefinitionFailureAnalyzer will give clues and hints on which classes could potentially be Spring beans that could be injected with some work on the developers part.
This is a Feature enhancement only applicable for SpringBoot 1.4+ projects
The text was updated successfully, but these errors were encountered: