You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "jerryshao (via GitHub)" <gi...@apache.org> on 2026/06/01 09:07:01 UTC
[PR] [#10508] fix(client-java-runtime): Exclude JDBC utils from shadow JAR to prevent NoClassDefFoundError [gravitino]
jerryshao opened a new pull request, #11324:
URL: https://github.com/apache/gravitino/pull/11324
### What changes were proposed in this pull request?
Exclude `org/apache/gravitino/utils/jdbc/**` from the `client-java-runtime` shadow JAR.
Also add `**/bin` to `.gitignore` to suppress Zed editor's JDT-generated class output directories.
### Why are the changes needed?
Fixes: #10508
`JdbcDataSourceFactory` in `:common` references `commons-dbcp2`, which is declared `compileOnly` there and therefore never bundled into `client-java-runtime`'s shadow JAR. However, the shadow JAR's relocation rewrites the reference to the shaded package name, producing a broken dangling reference with no backing class.
Connector runtime JARs (Spark, Flink, filesystem-hadoop3) all bundle `client-java-runtime` and are typically placed on the engine's system classpath. Due to Java's parent-first class delegation, `AppClassLoader` picks up `JdbcDataSourceFactory` from the connector runtime JAR (shaded reference, no shaded class) rather than from `gravitino-jobs.jar`, which has the correct self-contained copy. This causes `NoClassDefFoundError` for the shaded `BasicDataSource` at runtime when running the built-in Iceberg update-stats job.
Removing these server-side JDBC utilities from `client-java-runtime` (client applications have no need for connection-pool utilities) allows class delegation to fall through to `gravitino-jobs.jar` where both the shaded reference and the shaded class are correctly bundled.
### Does this PR introduce any user-facing change?
#### User-facing API changes
- No
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#10508] fix(client-java-runtime): Exclude JDBC utils from shadow JAR to prevent NoClassDefFoundError [gravitino]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11324:
URL: https://github.com/apache/gravitino/pull/11324#issuecomment-4591747618
<!-- coverage-report -->
### Code Coverage Report
|Overall Project|66.73% **`+0.02%`**|:green_circle:|
|:-|:-|:-:|
|Files changed|91.43%|:green_circle:|
<br>
|Module|Coverage||
|:-|:-|:-:|
|aliyun|1.72%|:red_circle:|
|api|46.82%|:green_circle:|
|authorization-common|85.96%|:green_circle:|
|aws|3.66%|:red_circle:|
|azure|2.47%|:red_circle:|
|catalog-common|10.04%|:red_circle:|
|catalog-fileset|80.33%|:green_circle:|
|catalog-glue|66.08%|:green_circle:|
|catalog-hive|79.55%|:green_circle:|
|catalog-jdbc-clickhouse|80.02%|:green_circle:|
|catalog-jdbc-common|45.31%|:green_circle:|
|catalog-jdbc-doris|80.28%|:green_circle:|
|catalog-jdbc-hologres|54.03%|:green_circle:|
|catalog-jdbc-mysql|79.23%|:green_circle:|
|catalog-jdbc-oceanbase|78.38%|:green_circle:|
|catalog-jdbc-postgresql|82.29%|:green_circle:|
|catalog-jdbc-starrocks|78.51%|:green_circle:|
|catalog-kafka|77.01%|:green_circle:|
|catalog-lakehouse-generic|44.89%|:green_circle:|
|catalog-lakehouse-hudi|79.1%|:green_circle:|
|catalog-lakehouse-iceberg|85.65% **`-0.11%`**|:green_circle:|
|catalog-lakehouse-paimon|79.29%|:green_circle:|
|catalog-model|77.72%|:green_circle:|
|cli|44.51%|:green_circle:|
|client-java|77.91%|:green_circle:|
|common|49.99%|:green_circle:|
|core|82.42% **`+0.03%`**|:green_circle:|
|filesystem-hadoop3|76.97%|:green_circle:|
|flink|0.0%|:red_circle:|
|flink-common|41.2%|:green_circle:|
|flink-runtime|0.0%|:red_circle:|
|gcp|14.12%|:red_circle:|
|hadoop-common|10.39%|:red_circle:|
|hive-metastore-common|53.26%|:green_circle:|
|iceberg-common|56.75%|:green_circle:|
|iceberg-rest-server|72.01%|:green_circle:|
|idp-basic|85.99%|:green_circle:|
|integration-test-common|0.0%|:red_circle:|
|jobs|66.17%|:green_circle:|
|lance-common|20.83%|:red_circle:|
|lance-rest-server|60.27%|:green_circle:|
|lineage|53.02%|:green_circle:|
|optimizer|82.95%|:green_circle:|
|optimizer-api|21.95%|:red_circle:|
|server|85.73%|:green_circle:|
|server-common|73.66%|:green_circle:|
|spark|32.79%|:red_circle:|
|spark-common|39.75%|:red_circle:|
|trino-connector|39.44%|:red_circle:|
<details>
<summary>Files</summary>
|Module|File|Coverage||
|:-|:-|:-|:-:|
|catalog-lakehouse-iceberg|[IcebergCatalogCapability.java](https://github.com/jerryshao/gravitino/blob/0ba97aef85cd6d4a4975f5b7a2db4ef5d95c6986/catalogs/catalog-lakehouse-iceberg/src/main/java/org/apache/gravitino/catalog/lakehouse/iceberg/IcebergCatalogCapability.java)|77.78%|:green_circle:|
|core|[Capability.java](https://github.com/jerryshao/gravitino/blob/0ba97aef85cd6d4a4975f5b7a2db4ef5d95c6986/core/src/main/java/org/apache/gravitino/connector/capability/Capability.java)|96.97%|:green_circle:|
||[SchemaNormalizeDispatcher.java](https://github.com/jerryshao/gravitino/blob/0ba97aef85cd6d4a4975f5b7a2db4ef5d95c6986/core/src/main/java/org/apache/gravitino/catalog/SchemaNormalizeDispatcher.java)|94.74%|:green_circle:|
</details>
--
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@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#10508] fix(client-java-runtime): Exclude JDBC utils from shadow JAR to prevent NoClassDefFoundError [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 merged PR #11324:
URL: https://github.com/apache/gravitino/pull/11324
--
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@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org