Skip to content

Commit 2a10ca8

Browse files
committed
[IcebergIO] Run xlang wrapper validation expansion service on Java 17
The cross-language wrapper validation launches the io expansion-service jar from Python via JAVA_HOME. That jar bundles IcebergIO, now Java 17 bytecode, so launching it on the default Java 11 fails with UnsupportedClassVersionError. createCrossLanguageUsingJavaExpansionTask was missing the JAVA_HOME redirect that #38974 added to the other cross-language task factories. Add it, driven by -PtestJavaVersion (resolving java\Home), and pass -PtestJavaVersion=17 in the Xlang_Generated_Transforms precommit so the expansion service runs on a JDK that can load the bundled Java 17 IOs.
1 parent b434723 commit 2a10ca8

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/beam_PreCommit_Xlang_Generated_Transforms.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,5 @@ jobs:
117117
with:
118118
gradle-command: :sdks:python:test-suites:direct:crossLanguageWrapperValidationPreCommit --info
119119
arguments: |
120+
-PtestJavaVersion=17
120121
-Pjava17Home=$JAVA_HOME_17_X64

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,6 +2721,11 @@ class BeamModulePlugin implements Plugin<Project> {
27212721
def usesDataflowRunner = config.pythonPipelineOptions.contains("--runner=TestDataflowRunner") || config.pythonPipelineOptions.contains("--runner=DataflowRunner")
27222722
String ver = project.findProperty('testJavaVersion')
27232723
def javaContainerSuffix = ver ? getSupportedJavaVersion(ver) : getSupportedJavaVersion()
2724+
// When a specific test JDK is requested (-PtestJavaVersion), launch the Python-started
2725+
// expansion service on it as well (see the exec block below). Some bundled IOs (e.g.
2726+
// IcebergIO) are compiled for Java 17, so the expansion service must run on a JDK that can
2727+
// load them. Mirrors the JAVA_HOME handling in the other cross-language task factories.
2728+
String testJavaHome = ver ? project.findProperty("java${ver}Home") : null
27242729

27252730
// Sets up, collects, and runs Python pipeline tests
27262731
project.tasks.register(config.name+"PythonUsingJava") {
@@ -2750,6 +2755,9 @@ class BeamModulePlugin implements Plugin<Project> {
27502755
project.exec {
27512756
// environment variable to indicate that jars have been built
27522757
environment "EXPANSION_JARS", config.expansionProjectPaths
2758+
if (testJavaHome) {
2759+
environment "JAVA_HOME", testJavaHome
2760+
}
27532761
String additionalDependencyCmd = ""
27542762
if (config.additionalDeps != null && !config.additionalDeps.isEmpty()){
27552763
additionalDependencyCmd = "&& pip install ${config.additionalDeps.join(' ')} "

0 commit comments

Comments
 (0)