Skip to content
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

Disabling springwolf breaks application #1073

Closed
nwwerum opened this issue Nov 13, 2024 · 4 comments · Fixed by #1075
Closed

Disabling springwolf breaks application #1073

nwwerum opened this issue Nov 13, 2024 · 4 comments · Fixed by #1075
Labels
bug Something isn't working staged for release

Comments

@nwwerum
Copy link
Contributor

nwwerum commented Nov 13, 2024

Describe the bug
When setting springwolf.enabled=false spring boot application with springwolf generic binding will not start anymore.

Dependencies and versions used
1.8, including springwolf.generic.binding

Code example
Include generic binding jar in the classpath of a spring boot app and set springwolf.enabled=false

Stack trace and error logs

org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncGenericOperationBindingProcessor' defined in class path resource [io/github/springwolf/addons/generic_binding/annotation/configuration/SpringwolfGenericBindingAutoConfiguration.class]: Unsatisfied dependency expressed through method 'asyncGenericOperationBindingProcessor' parameter 0: No qualifying bean of type 'org.springframework.util.StringValueResolver' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

Problem seems to be that SpringwolfGenericBindingAutoConfiguration does not react to the enabled property and will try to create its bean in any case, even if other springwolf beans (in this case StringValueResolverProxy) are not created.

An easy solution would be to add a @ConditionalOnBean(StringValueResolver.class) to the asyncGenericOperationBindingProcessor() method.
Edit: other autoconfigs replicate the @ConditionalOnProperty (and do not use a @ConditionalOnBean), so it makes sense to handle this the same way.

@nwwerum nwwerum added the bug Something isn't working label Nov 13, 2024
Copy link

Welcome to Springwolf. Thanks a lot for reporting your first issue. Please check out our contributors guide and feel free to join us on discord.

@timonback
Copy link
Member

Awesome, thank you for the contribution!

Copy link

The change is staged for release and will be part of the next release.

If you want to try and verify it in your application today,
use the latest 1.X.0-SNAPSHOT build as described in our README.md > Testing SNAPSHOT version

Thank you for the report/contribution!

Copy link

The change is available in the latest release. 🎉

Thank you for the report/contribution and making Springwolf better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working staged for release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants