No qualifying bean of type 'org.jooq.DSLContext' available

650 views
Skip to first unread message

Debapriya Patra

unread,
Feb 19, 2020, 1:52:22 AM2/19/20
to jOOQ User Group
Hi,

I am trying to setup a new micro-service using spring-boot and jooq. I am able to generate the POJOs from the DB schema but when I am starting the application I am getting an error as below.

02-18-2020 22:39:48.707 | Test worker | requestId: | ERROR | LoggingFailureAnalysisReporter - 

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

Description:

Field dsl in com.chegg.prep.seo.service.dao.BaseRepository required a bean of type 'org.jooq.DSLContext' that could not be found.

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.jooq.DSLContext' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1654)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1213)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1167)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)

Can someone help me understand what am I missing here while setting up the dependencies or configurations ?


Thanks,
Deba

Debapriya Patra

unread,
Feb 19, 2020, 2:12:08 AM2/19/20
to jOOQ User Group
I have the spring datasource properties in my property file as well. But still I am getting this error.

spring.datasource.url=jdbc:postgresql://localhost:5432/prepseo
spring.datasource.username=flashtools
spring.datasource.password=flashtools

spring.datasource.driver-class-name=org.postgresql.Driver
spring.jooq.sql-dialect=Postgres
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=PrepSeoServiceDB
spring.datasource.hikari.initial-size=5
spring.datasource.hikari.maximum-pool-size=40
spring.datasource.hikari.minimum-idle=2
spring.datasource.hikari.idle-timeout=10000
spring.datasource.prepStmtCacheSize=250
spring.datasource.prepStmtCacheSqlLimit=2048

Lukas Eder

unread,
Feb 19, 2020, 3:06:47 AM2/19/20
to jOOQ User Group
Hi Deba,

Thank you very much for your message.

It looks like you have not configured any DSLContext instance from any of your @Configuration classes, e.g. using the @Bean annotation.

I'm happy to help you further with this issue if you can provide a more complete example. For your convenience, we have a template that can be used to provide minimal, complete, verifiable examples: https://github.com/jOOQ/jOOQ-mcve

Thanks,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/4be3bd43-2f57-48fc-b930-3cb7761ab3e8%40googlegroups.com.

Debapriya Patra

unread,
Feb 19, 2020, 1:51:08 PM2/19/20
to jooq...@googlegroups.com
Hi Lukas,

I have four different micro services which is having the exact setup and I don't see configuring the DSLContext anywhere in the @Configuration classes. I am not sure what is missing in this service which is causing this issue.
What exactly you need from me to figure out the issue ? I would be happy to send the details.

Cheers,
Debapriya Patra
650.933.6852


Debapriya Patra

unread,
Feb 19, 2020, 2:51:00 PM2/19/20
to jOOQ User Group
Hi Lukas,

I am able to resolve the issue. Actually my SpringBoot application has @SpringBootApplication(exclude={DataSourceAutoConfiguration.class}).
After I remove exclude={DataSourceAutoConfiguration.class} (@SpringBootApplication), it was able to create the DSLContext.

Thank you for the reply.

Thanks,
Deba

On Tuesday, February 18, 2020 at 10:52:22 PM UTC-8, Debapriya Patra wrote:
Reply all
Reply to author
Forward
0 new messages