Jooq in multi module Spring Boot application with Gradle

24 views
Skip to first unread message

rrdiber

unread,
Feb 28, 2020, 9:15:52 AM2/28/20
to jOOQ User Group
Hi Lukas,

Im trying to use Jooq in a multi module Spring Boot Application with Gradle and JDK 11.

The project is splitted into one module per layer (domain, persistence, service, rest-api) and the jooq dependency ('org.springframework.boot:spring-boot-starter-jooq') is in the persistence module.

For code generation I use etiennestuder/gradle-jooq-plugin and it works fine.

When I run the application and try to execute a query i get the Exception: 

java.lang.ClassNotFoundException: org.jooq.TableOptions
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
...

 If I use Jooq in a single module Spring Boot Gradle application it works fine.

The problem would seem to be with multi-modules. Please do you have a suggestion about what the problem should be?

Thanks.

Lukas Eder

unread,
Feb 28, 2020, 9:32:18 AM2/28/20
to jOOQ User Group
Hello,

This class has been added in jOOQ 3.13. You're probably using a Spring Boot version that depends on jOOQ 3.12. Please upgrade your jOOQ dependency.

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/3d2c444c-5d50-48c9-ae58-125294f64d39%40googlegroups.com.

Rubén R Di Bernardo

unread,
Feb 28, 2020, 10:41:22 AM2/28/20
to jOOQ User Group
Yes, effectively. Spring boot 2.2.x has 3.12.4 jooq version.
Thanks!


El viernes, 28 de febrero de 2020, 11:32:18 (UTC-3), Lukas Eder escribió:
Hello,

This class has been added in jOOQ 3.13. You're probably using a Spring Boot version that depends on jOOQ 3.12. Please upgrade your jOOQ dependency.

Thanks,
Lukas

On Fri, Feb 28, 2020 at 3:15 PM rrdiber <rrdibe...@gmail.com> wrote:
Hi Lukas,

Im trying to use Jooq in a multi module Spring Boot Application with Gradle and JDK 11.

The project is splitted into one module per layer (domain, persistence, service, rest-api) and the jooq dependency ('org.springframework.boot:spring-boot-starter-jooq') is in the persistence module.

For code generation I use etiennestuder/gradle-jooq-plugin and it works fine.

When I run the application and try to execute a query i get the Exception: 

java.lang.ClassNotFoundException: org.jooq.TableOptions
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
...

 If I use Jooq in a single module Spring Boot Gradle application it works fine.

The problem would seem to be with multi-modules. Please do you have a suggestion about what the problem should be?

Thanks.

--
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...@googlegroups.com.

Lukas Eder

unread,
Mar 2, 2020, 5:24:54 AM3/2/20
to jOOQ User Group
For the record, here's a useful article showing how to override the Spring Boot transitive dependency:

I hope this helps 

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/57e8d868-baf8-40f6-9674-b01c43cadf6e%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages