Skip to content

GH-1544 Package the nested URL handler factory with the GCF launcher - #1548

Open
zemiles wants to merge 1 commit into
spring-cloud:mainfrom
zemiles:main
Open

zemiles wants to merge 1 commit into
spring-cloud:mainfrom
zemiles:main

Conversation

@zemiles

@zemiles zemiles commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Problem

The Google Cloud Functions invoker loads GcfJarLauncher from the root of the repackaged JAR. During static initialization, the launcher creates a NestedUrlStreamHandlerFactory, which is compiled into a separate class file.

GcfJarLayout.writeLoadedClasses() copies GcfJarLauncher.class to the JAR root but omits GcfJarLauncher$NestedUrlStreamHandlerFactory.class. The invoker therefore throws NoClassDefFoundError before it can initialize the launcher.

Changes

  • Write both class files under the same package path at the root of the repackaged JAR.
  • Add GcfJarLayoutTests to generate a JAR with the production layout and inspect it for both entries.

Verification

  • Confirmed that the regression test fails on the missing factory entry with the original layout and passes with this change.
  • Ran all 25 GCP adapter tests on JDK 17, including the new regression test. All passed.
  • A separate run with dependency-module tests stopped in spring-cloud-function-context. Two existing tests could not delete a temporary allowlist.jar on Windows.

Resolves #1544

…CF launcher

Include the nested factory class alongside the launcher so the GCF invoker
can initialize it. Add a regression test that checks both JAR entries.

Resolves spring-cloud#1544

Signed-off-by: 안승현 <abeb3@naver.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invoker

1 participant