spring-cloud / spring-cloud-function

Apache License 2.0
1.04k stars 618 forks source link

GCP HTTP Example fails to deploy - ClassNotFound exception - JarLauncher #1195

Closed rajakumare1 closed 1 month ago

rajakumare1 commented 1 month ago

Need to reopen "https://github.com/spring-cloud/spring-cloud-function/issues/1085"

Describe the bug Building and deploying the Main branch version of spring-cloud-function-samples/function-sample-gcp-http fails with 'java.lang.ClassNotFoundException: org.springframework.boot.loader.JarLauncher'

The 4.0.x branch still packages and deploys as expected.

Steps Clone project && cd project ./mvnw install cd spring-cloud-function-samples/function-sample-gcp-http mvn package gcloud functions deploy function-sample-gcp-http --entry-point org.springframework.cloud.function.adapter.gcp.GcfJarLauncher --runtime java17 --trigger-http --source target/deploy --memory 512MB

deploy fails with above exception.

What works cd projectRoot git checkout 4.0.x mvn clean cd spring-cloud-function-samples/function-sample-gcp-http mvn package gcloud functions deploy function-sample-gcp-http --entry-point org.springframework.cloud.function.adapter.gcp.GcfJarLauncher --runtime java17 --trigger-http --source target/deploy --memory 512MB

Further Info I tried JDK20, 21 and 17. All Temurin.

rajakumare1 commented 1 month ago

Someone please look into it as the support for Spring 3.1 is over and the bug is happening is 3.3.4 Spring boot.

rajakumare1 commented 1 month ago

Opened wrongly