Help Needed: Custom Debezium SMT - Unable to Find Class (Docker + Debezium Server)

56 views
Skip to first unread message

pramod choudhari

unread,
Mar 3, 2025, 11:06:36 PM3/3/25
to debezium

Im trying to configure a Custom SMT in Debezium Server (running via Docker), but I keep getting this error in logs:

Caused by: java.lang.IllegalArgumentException: Unable to find class com.example.debezium.transforms.TableSpecificOrderingKey


below is my docker-compose.yml
services:
debezium-server:
container_name: debezium-server
platform: linux/amd64
environment:
- APP_ENV=local
- PLUGIN_PATH=/debezium/libs
volumes:
- ./config:/debezium/config
- ./entrypoint.sh:/debezium/entrypoint.sh
- ./data:/debezium/data
- ./plugins:/debezium/libs
network_mode: "host"
command: ["/debezium/entrypoint.sh"]
restart: no



Below is my entrypoint.sh
#!/bin/sh
# If APP_ENV is set (e.g., local, dev, stage, prod), copy that config file
if [ -n "$APP_ENV" ]; then
echo "Using environment configuration: $APP_ENV"
cp /debezium/config/$APP_ENV/application.properties /debezium/config/application.properties
fi

echo "==== Contents of /debezium/config/application.properties ===="
cat /debezium/config/application.properties
ls -rlt /debezium/libs
jar -tf /debezium/libs/custom-smt-1.0-SNAPSHOT.jar
echo "============================================================"

# Now run the original Debezium Server entrypoint
exec /debezium/run.sh



Below are the logs when i run docker-compose-local.yml up -d

Using environment configuration: local
==== Contents of /debezium/config/application.properties ====
# --- Debezium Configuration ---
debezium.format.key=json
debezium.format.value=json
debezium.format.header=json

debezium.source.plugin.path=/debezium/libs


record.processing.shutdown.timeout.ms=5000
task.management.timeout.ms=180000

# --- Quarkus Configuration ---
quarkus.http.port=8080
quarkus.log.console.json=false
quarkus.log.level=TRACE


# --- Sink Configuration: Pubsub ---
debezium.sink.type=pubsub
debezium.sink.pubsub.project.id=fintech-app
debezium.sink.pubsub.ordering.enabled=true

....

# --- Transforms ---
debezium.source.transforms=routeDynamic,tableSpecificOrderingKey


debezium.source.transforms.routeDynamic.type=org.apache.kafka.connect.transforms.RegexRouter
debezium.source.transforms.routeDynamic.regex=^colossus_local_prefix\.([^\.]+)\..*$
debezium.source.transforms.routeDynamic.replacement=$1_cdc_development

debezium.source.transforms.tableSpecificOrderingKey.type=com.example.debezium.transforms.TableSpecificOrderingKeytotal 8
-rw-r--r-- 1 jboss root 4251 Mar  4 03:03 custom-smt-1.0-SNAPSHOT.jar
META-INF/
META-INF/MANIFEST.MF
com/
com/example/
com/example/debezium/
com/example/debezium/transforms/
META-INF/maven/
META-INF/maven/com.example.debezium/
META-INF/maven/com.example.debezium/custom-smt/
com/example/debezium/transforms/TableSpecificOrderingKey.class
META-INF/maven/com.example.debezium/custom-smt/pom.xml
META-INF/maven/com.example.debezium/custom-smt/pom.properties
============================================================
 ...
converter.type = header
...
plugin.path = [/debezium/libs]
...
Caused by: java.lang.IllegalArgumentException: Unable to find class com.example.debezium.transforms.TableSpecificOrderingKey
...


Could anyone please help me here? as per the jar contents seen in the log the class is present in at the correct path.



jiri.p...@gmail.com

unread,
Mar 4, 2025, 12:29:39 AM3/4/25
to debezium
Hi,

why there is character 8 for value of debezium.source.transforms.tableSpecificOrderingKey.type config option?

Jiri

pramod choudhari

unread,
Mar 4, 2025, 12:33:54 AM3/4/25
to debezium
Hi Jiri,
its the output of ls -rlt /debezium/libs
from entrypoint.sh

also i saw this stack oveflow link https://tinyurl.com/2p97k6sp
and then changed my directory structue as below, i.e add custom-smt directory inside the plugins folder and then copied the jar over there, but still same issue.

Screenshot 2025-03-04 at 11.02.57 AM.png

jiri.p...@gmail.com

unread,
Mar 4, 2025, 12:43:51 AM3/4/25
to debezium
Please put the JAR into lib directory (where other JARs are) not to libs directory.

pramod choudhari

unread,
Mar 4, 2025, 1:58:57 AM3/4/25
to debezium
Thanks, will give it a try!

Chris Cranford

unread,
Mar 4, 2025, 6:15:08 AM3/4/25
to debe...@googlegroups.com
Hi, did you make sure your SMT was compiled with Java 21?

Thanks,
Chris


On 3/3/25 23:03, pramod choudhari wrote:

I'm trying to configure a Custom SMT in Debezium Server (running via Docker), but I keep getting this error in logs:

Caused by: java.lang.IllegalArgumentException: Unable to find class com.example.debezium.transforms.TableSpecificOrderingKey




below is my docker-compose.yml
services:
debezium-server:
container_name: debezium-server
platform: linux/amd64
environment:
- APP_ENV=local
- GOOGLE_APPLICATION_CREDENTIALS=/debezium/secrets/fintech-app-cc96336fe9ad.json
- PLUGIN_PATH=/debezium/libs
volumes:
- ./config:/debezium/config
- ./entrypoint.sh:/debezium/entrypoint.sh
- ./plugins:/debezium/libs
- ./secrets/fintech-app-cc96336fe9ad.json:/debezium/secrets/fintech-app-cc96336fe9ad.json:ro
Could anyone please help me? why debezium is not able to find the class? as per the jar contennts and plug

--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/debezium/73b62a72-50d2-441d-a635-ffd30c6588d0n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages