-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
SpringBoot 3.4.0 Error creating bean with name 'openApiResource' #2819
Comments
Through analysis, the problem should be here https://github.com/springdoc/springdoc-openapi/blob/main/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java#L269
It is possible that it is related to the loading logic of the new version of Springboot,Add a breakpoint at |
Not reproducible. This ticket will be closed, but can be reopened if your provide the reproducible sample. |
SpringBoot: 3.4.3 This problem may not be reproduced in the smallest sample project, but in a system with more code, this problem occurs and I extracted the exception stack for this problem. When there are many automatic configurations, it may interfere with the registration order of springdoc-related beans, resulting in this problem.
I tried rewriting @EventListener
public void onApplicationEvent(ApplicationReadyEvent event) {
if (springDocConfigProperties.isPreLoadingEnabled()) {
if (CollectionUtils.isEmpty(springDocConfigProperties.getPreLoadingLocales())) {
Executors.newSingleThreadExecutor().execute(abstractOpenApiResource::getOpenApi);
}
else {
for (String locale : springDocConfigProperties.getPreLoadingLocales()) {
Executors.newSingleThreadExecutor().execute(() -> abstractOpenApiResource.getOpenApi(Locale.forLanguageTag(locale)));
}
}
}
} Using ApplicationReadyEvent in AbstractOpenApiResource causes the same problem. |
Describe the bug
SpringBoot: 3.4.0
SpringDoc: 2.7.0
Application cannot be start
To Reproduce
Additional context
The text was updated successfully, but these errors were encountered: