You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "david-streamlio (via GitHub)" <gi...@apache.org> on 2026/10/21 15:49:08 UTC

[PR] [fix][build] Include the java.compiler module in the Pulsar image JVM [pulsar]

david-streamlio opened a new pull request, #27035:
URL: https://github.com/apache/pulsar/pull/27035

   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
   - [x] Anything that affects deployment: the official Docker image's JVM gains the `java.compiler` module.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][build] Include the java.compiler module in the Pulsar image JVM [pulsar]

Posted by "codelipenghui (via GitHub)" <gi...@apache.org>.
codelipenghui merged PR #27035:
URL: https://github.com/apache/pulsar/pull/27035


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org