1

I'm try to use Parser CLI, and I dont know how to solve it.

Can someone help me?

java -cp jooq-3.15.0-SNAPSHOT.jar:reactive-streams-1.0.3.jar \ 
  org.jooq.ParserCLI -T ORACLE \
  -s "SELECT substring('abcde', 2, 3)"

Exception in thread "main" java.lang.NoClassDefFoundError: io/r2dbc/spi/ConnectionFactory at org.jooq.ParserCLI.ctx(ParserCLI.java:88)
at org.jooq.ParserCLI.main(ParserCLI.java:72)
Caused by: java.lang.ClassNotFoundException: io.r2dbc.spi.ConnectionFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) ... 2 more

Paul Roub
  • 36,322
  • 27
  • 84
  • 93

2 Answers2

1

You're missing the R2DBC dependency. Please refer to the documentation of jOOQ version 3.15.0:

java -cp jooq-3.15.0-SNAPSHOT.jar:reactive-streams-1.0.3.jar:r2dbc-spi-0.9.0.M1.jar org.jooq.ParserCLI -h

It's probably worth hinting at this also from the error message, rather than just letting the JVM throw a generic NoClassDefFoundError. I've created an improvement request: https://github.com/jOOQ/jOOQ/issues/11932

Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
0

Just in addition to Lukas Eder answer, it's definitely the problem because of missing dependency in POM file:

https://mvnrepository.com/artifact/org.jooq/jooq/3.15.0

I've reproduced similar issue as:

java.lang.NoClassDefFoundError: io/r2dbc/spi/ConnectionFactory
  at org.springframework.boot.autoconfigure.r2dbc.NoConnectionFactoryBeanFailureAnalyzer.analyze(NoConnectionFactoryBeanFailureAnalyzer.java:49) ~[spring-boot-autoconfigure-2.7.5.jar:2.7.5]
  at org.springframework.boot.autoconfigure.r2dbc.NoConnectionFactoryBeanFailureAnalyzer.analyze(NoConnectionFactoryBeanFailureAnalyzer.java:34) ~[spring-boot-autoconfigure-2.7.5.jar:2.7.5]
  at org.springframework.boot.diagnostics.AbstractFailureAnalyzer.analyze(AbstractFailureAnalyzer.java:34) ~[spring-boot-2.7.5.jar:2.7.5]
  at org.springframework.boot.diagnostics.FailureAnalyzers.analyze(FailureAnalyzers.java:124) ~[spring-boot-2.7.5.jar:2.7.5]
  at org.springframework.boot.diagnostics.FailureAnalyzers.reportException(FailureAnalyzers.java:117) ~[spring-boot-2.7.5.jar:2.7.5]
  at org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:814) ~[spring-boot-2.7.5.jar:2.7.5]
  at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:788) ~[spring-boot-2.7.5.jar:2.7.5]
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) ~[spring-boot-2.7.5.jar:2.7.5]
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.7.5.jar:2.7.5]
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-2.7.5.jar:2.7.5]

And the problem was because of missing dependency as:

<dependency>
    <groupId>org.jooq</groupId>
    <artifactId>jooq</artifactId>
    <version>3.15.0</version>
</dependency>
invzbl3
  • 5,872
  • 9
  • 36
  • 76