Problem with Jooq codegen

29 views
Skip to first unread message

Steven Barnes

unread,
Mar 5, 2025, 2:52:29 AM3/5/25
to Kill Bill users mailing-list
I am trying to create a plugin based on the stripe-plugin. When running the codegen script, I get this error:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at org.jooq.util.jaxb.tools.MiniJAXB.getNamespace(MiniJAXB.java:393)
at org.jooq.util.jaxb.tools.MiniJAXB.addDefaultNamespace(MiniJAXB.java:186)
at org.jooq.util.jaxb.tools.MiniJAXB.unmarshal0(MiniJAXB.java:173)
at org.jooq.util.jaxb.tools.MiniJAXB.unmarshal(MiniJAXB.java:159)
at org.jooq.codegen.GenerationTool.load(GenerationTool.java:1024)
at org.jooq.codegen.GenerationTool.main(GenerationTool.java:189)

My guess is that this is due to upgrading from Java 8 to 11, as jaxb was moved out of the standard library.

Pierre-Alexandre Meyer

unread,
Mar 5, 2025, 2:55:31 AM3/5/25
to Steven Barnes, Kill Bill users mailing-list
Which version of jOOQ are you using? Can you try 3.15.12?

It looks like this has been fixed: https://github.com/jOOQ/jOOQ/issues/12286


--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/killbilling-users/495a97f7-bd21-47e1-ab30-b5872c03e00cn%40googlegroups.com.


--
Pierre

Steven Barnes

unread,
Mar 5, 2025, 11:15:44 AM3/5/25
to Pierre-Alexandre Meyer, Kill Bill users mailing-list
I will try that at work, but running codegen on the strip-plugin project as configured in git no longer works. 

Steven Barnes

unread,
Mar 5, 2025, 3:24:55 PM3/5/25
to Kill Bill users mailing-list
I have update the script to use JOOQ_VERSION=3.15.12 and the problem is still happening. I can try locating the missing JAR but the find jars website no longer works

Pierre-Alexandre Meyer

unread,
Mar 5, 2025, 3:25:49 PM3/5/25
to Steven Barnes, Kill Bill users mailing-list
Have you reached out to the jOOQ team? They should be able to help.

Shaun Forgie

unread,
Mar 5, 2025, 7:31:12 PM3/5/25
to Steven Barnes, Kill Bill users mailing-list
HI Steven,

To help you could raise a ticket to track this that includes your hunch about the missing jaxb library being moved into an external module which sounds like the cause for sure. 

Linking it to https://github.com/jOOQ/jOOQ/issues/12286 would also be advisable.

Rgs
Shaun



--
Shaun Forgie [Principal] - Method Maker Ltd
57a McIntyre Rd, Manukau 2022, Auckland, New Zealand
Mobile +64 21 666 910 https://www.linkedin.com/in/shaunforgie/

Steven Barnes

unread,
Mar 6, 2025, 4:57:32 AM3/6/25
to Pierre-Alexandre Meyer, Kill Bill users mailing-list
I am following the guides for kill bill plugins, and expect the provided instructions to be usable. You are only able to build the stripe-plugin because you already generated the code back when it worked. This is a poor experience for anyone trying to create a new plugin.

As I understand it, KB is using an older version of JOOQ for some reason, probably dependency hell.

At this point I will try hacking the code gen to use the latest version of JOOQ.

Steven Barnes

unread,
Mar 6, 2025, 4:57:36 AM3/6/25
to Kill Bill users mailing-list
Here is my modified version of the script. Note that I gave up on using maven to download JOOQ, as the <parent> setting in the pom.xml seems to override the JOOQ version.

#!/bin/bash

# Load the DDL schema in MySQL
DDL_DIR="`dirname \"$0\"`"
mysql -u root -proot killbill < "${DDL_DIR}"/ddl.sql

# Download the required jars
MVN_DOWNLOAD="mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get -DremoteRepositories=https://repo.maven.apache.org/maven2"
#JOOQ_VERSION=3.13.4
JOOQ_VERSION=3.20.0
REACTIVE_STREAM_VERSION=1.0.2
MYSQL_VERSION=8.0.21
#$MVN_DOWNLOAD -Dartifact=org.jooq:jooq:$JOOQ_VERSION:jar
#$MVN_DOWNLOAD -Dartifact=org.jooq:jooq-meta:$JOOQ_VERSION:jar
#$MVN_DOWNLOAD -Dartifact=org.jooq:jooq-codegen:$JOOQ_VERSION:jar
cs fetch org.jooq:jooq:$JOOQ_VERSION
cs fetch org.jooq:jooq-meta:$JOOQ_VERSION
cs fetch org.jooq:jooq-codegen:$JOOQ_VERSION

$MVN_DOWNLOAD -Dartifact=org.reactivestreams:reactive-streams:$REACTIVE_STREAM_VERSION:jar
$MVN_DOWNLOAD -Dartifact=mysql:mysql-connector-java:$MYSQL_VERSION:jar

M2_REPOS=~/.m2/repository
#JOOQ="$M2_REPOS/org/jooq"
JOOQ="~/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jooq"
MYSQL="$M2_REPOS/mysql/mysql-connector-java/$MYSQL_VERSION/mysql-connector-java-$MYSQL_VERSION.jar"
REACTIVE_STREAMS="$M2_REPOS/org/reactivestreams/reactive-streams/$REACTIVE_STREAM_VERSION/reactive-streams-$REACTIVE_STREAM_VERSION.jar"
JARS="$JOOQ/jooq/$JOOQ_VERSION/jooq-$JOOQ_VERSION.jar:$JOOQ/jooq-meta/$JOOQ_VERSION/jooq-meta-$JOOQ_VERSION.jar:$JOOQ/jooq-codegen/$JOOQ_VERSION/jooq-codegen-$JOOQ_VERSION.jar:$REACTIVE_STREAMS:$MYSQL:.";

$MVN_DOWNLOAD -Dartifact=jakarta.xml.bind:jakarta.xml.bind-api:3.0.0:jar
$MVN_DOWNLOAD -Dartifact=io.r2dbc:r2dbc-spi:1.0.0.RELEASE:jar

JAXB="$M2_REPOS/jakarta/xml/bind/jakarta.xml.bind-api/3.0.0/jakarta.xml.bind-api-3.0.0.jar"
R2DBC="$M2_REPOS/io/r2dbc/r2dbc-spi/1.0.0.RELEASE/r2dbc-spi-1.0.0.RELEASE.jar"
JARS="$JAXB:$R2DBC:$JARS"

# Run jOOQ's generation tool
java -cp $JARS org.jooq.codegen.GenerationTool ./src/main/resources/gen.xml

On Tuesday, March 4, 2025 at 11:55:31 PM UTC-8 Pierre-Alexandre Meyer wrote:

Pierre-Alexandre Meyer

unread,
Mar 6, 2025, 5:00:49 AM3/6/25
to Steven Barnes, Kill Bill users mailing-list

Steven Barnes

unread,
Mar 9, 2025, 5:52:51 AM3/9/25
to Kill Bill users mailing-list
Thanks, that works.
Reply all
Reply to author
Forward
0 new messages