Skip to content

[fix][build] Include the java.compiler module in the Pulsar image JVM - #27035

Merged
codelipenghui merged 1 commit into
apache:masterfrom
david-streamlio:fix/docker-java-compiler-module
Oct 21, 2026
Merged

codelipenghui merged 1 commit into
apache:masterfrom
david-streamlio:fix/docker-java-compiler-module

Conversation

@david-streamlio

Copy link
Copy Markdown
Contributor

Fixes #27034

Motivation

#26086 trimmed the JDK modules in the Pulsar image's jlink runtime, leaving out modules that a jdeps/bytecode scan showed Pulsar's shipped jars don't use, including java.compiler. Since PIP-465 (#25408), connectors are no longer shipped with Pulsar, so they weren't part of that scan, but users still deploy connector NARs on this image.

Debezium's io.debezium.config.Field.isClassName calls javax.lang.model.SourceVersion.isName, which lives in java.compiler. As a result, Debezium sources fail on the 5.0.0 image:

java.lang.NoClassDefFoundError: javax/lang/model/SourceVersion
	at io.debezium.config.Field.isClassName(Field.java:1259)

Reported in apache/pulsar-connectors#146 and diagnosed in discussion #27020.

Modifications

  • Add java.compiler to JDK_MODULES in docker/pulsar/Dockerfile.
  • Move it from the "Left out" comment to "Kept on purpose", explaining why: connectors run on the image but aren't covered by the scan.

java.compiler is API-only, depends only on java.base, and adds about 250 KB. It doesn't pull in jdk.compiler or the ~10 MB lib/ct.sym that the trimming was mainly meant to drop; those stay excluded.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework without any test coverage. Verified locally:

  • Built a jlink runtime of java.base,java.logging: calling SourceVersion.isName(...) fails with the same NoClassDefFoundError. With java.compiler added it succeeds, and the runtime contains only java.base, java.compiler and java.logging, with no lib/ct.sym (about 232 KB larger).
  • Confirmed the SourceVersion.isName call is present in debezium-core-3.4.3.Final, the version apache/pulsar-connectors currently builds against.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment: the official Docker image's JVM gains the java.compiler module.

Debezium connectors call javax.lang.model.SourceVersion, which lives in
java.compiler. The jlink runtime in the Pulsar image left the module out,
so Debezium sources fail on the 5.0.0 image with NoClassDefFoundError.

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The targeted addition of java.compiler restores the API needed by Debezium while retaining the trimmed runtime without compiler tooling. No actionable findings identified within the reviewed scope.

Reviewed head: 43d932d. Source inspection only; no local image build or Debezium reproduction was run.

@codelipenghui
codelipenghui merged commit cfc00b0 into apache:master Oct 21, 2026
43 checks passed
lhotari pushed a commit that referenced this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Debezium sources fail on the 5.0.0 Docker image: java.compiler module missing from the JVM

4 participants