如何修复“考虑在您的配置中定义一个 'org.jooq.DSLContext' 类型的 bean."更新到 jOOQ 3.15.0 后 [英] How to fix "Consider defining a bean of type 'org.jooq.DSLContext' in your configuration." after update to jOOQ 3.15.0

查看:21
本文介绍了如何修复“考虑在您的配置中定义一个 'org.jooq.DSLContext' 类型的 bean."更新到 jOOQ 3.15.0 后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Vaadin 和 Spring Boot 应用程序中,我已从 jOOQ 3.14.12 更新到 3.15.0.此次更新后,我的应用程序不再启动.这是我得到的错误:

In my Vaadin and Spring Boot application, I have updated from jOOQ 3.14.12 to 3.15.0. After this update my application is not starting up again. This is the error I get:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of constructor in org.komunumo.data.service.MemberService required a bean of type 'org.jooq.DSLContext' that could not be found.


Action:

Consider defining a bean of type 'org.jooq.DSLContext' in your configuration.

我不明白为什么我必须定义这个 bean,因为使用 jOOQ 3.14.12 我没有必要.据我所知,这是由 JooqAutoConfiguration 自动完成的.

I don't understand why I have to define this bean, because with jOOQ 3.14.12 I did not have to. As far as I know, this is done by JooqAutoConfiguration automatically.

推荐答案

Spring Boot 2.6 答案

使用 Spring Boot 2.6,此问题不再重现,请参阅 https://github.com/spring-projects/spring-boot/issues/26439

从 jOOQ 3.15.0 开始,jOOQ 附带一个内置的 R2DBC 依赖项.Spring Boot 2.5 尚未意识到这一点,因此,您必须从您的spring 启动应用程序(当然,除非您使用带有 jOOQ 的 R2DBC):

Starting from jOOQ 3.15.0, jOOQ ships with a built-in R2DBC dependency. Spring Boot 2.5 is not yet aware of this, and as such, you'll have to explicitly exclude R2dbcAutoConfiguration (not R2dbcDataAutoConfiguration!) from your spring boot application (unless you're using R2DBC with jOOQ, of course):

@SpringBootApplication(exclude = { R2dbcAutoConfiguration.class })

注意,您可能会看到以下错误消息:

Note, you may see the following error message:

没有可用的org.jooq.DSLContext"类型的合格 bean:预计至少有 1 个 bean 有资格作为自动装配候选.

No qualifying bean of type 'org.jooq.DSLContext' available: expected at least 1 bean which qualifies as autowire candidate.

我在这里添加的内容,否则人们可能无法从 Google 中找到此答案.

Which I'm adding here, because otherwise, people might not find this answer from Google.

这篇关于如何修复“考虑在您的配置中定义一个 'org.jooq.DSLContext' 类型的 bean."更新到 jOOQ 3.15.0 后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆