[Bug] All Flink 2.x SQL jobs fail with NoClassDefFoundError: FlinkTableInitializerV2
- Dominant language
- Java
- Stars
- 4.3k
- Forks
- 1.1k
- Avg merge
- 13h 35m
- Merged PRs (30d)
- 2
Description
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/streampark/issues?q=is%3Aissue+label%3A%22bug%22) 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.()`. 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
```log
java.lang.NoClassDefFoundError: org/apache/streampark/flink/core/FlinkTableInitializerV2
at org.apache.streampark.flink.core.TableContext.(...)
at org.apache.streampark.flink.cli.SqlClient$.main(...)
```
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in streampark-console-service/pom.xml and compare its compile dependency on streampark-flink-shims-base with the provided dependencies in the shims_flink-2.x modules. Build the distribution and run a Flink 2.x remote SQL application to verify the client resolves FlinkTableInitializerV2 and no longer throws NoClassDefFoundError; confirm Flink 1.x behavior remains unaffected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100