Skip to content

[Bug] All Flink 2.x SQL jobs fail with NoClassDefFoundError: FlinkTableInitializerV2 #4490

Description

@88fantasy

Search before asking

  • I had searched in the issues and found no similar issues referencing FlinkTableInitializerV2 / streampark-flink-shims-base-v2.

Java Version

Temurin 21.0.11 (console), built with Microsoft OpenJDK 11.0.28

Scala Version

2.12.x

StreamPark Version

3.0.0-SNAPSHOT (dev branch, commit 9ddda84c9)

Flink Version

2.2.1 (official binary distribution, standalone/remote cluster)

Deploy mode

remote

What happened

Every Flink 2.x SQL application fails while the client builds the JobGraph:

NoClassDefFoundError: org/apache/streampark/flink/core/FlinkTableInitializerV2

thrown from SqlClient.main() -> TableContext.<init>(). Flink 1.x SQL jobs are unaffected.

FlinkTableInitializerV2 lives in streampark-flink-shims-base-v2. streampark-console-service/pom.xml declares a normal compile dependency on the v1 module, streampark-flink-shims-base — so v1 ends up in the console's own lib/ — but declares no equivalent dependency on streampark-flink-shims-base-v2. The only references to v2 are the provided dependencies on streampark-flink-shims_flink-2.0/2.1/2.2/2.3, which exist to order the reactor for -am builds and do not put anything into the distribution.

The result is that TableContext (in each shims_flink-2.x module) can never resolve the v2 base class it depends on at runtime.

Most likely a line missed when 2.x support was added in e770d2e8e.

Error Exception

java.lang.NoClassDefFoundError: org/apache/streampark/flink/core/FlinkTableInitializerV2
	at org.apache.streampark.flink.core.TableContext.<init>(...)
	at org.apache.streampark.flink.cli.SqlClient$.main(...)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions