-
Notifications
You must be signed in to change notification settings - Fork 629
Could not invoke function: Could not construct an instance of org.springframework.cloud.function.adapter.gcp.GcfJarLauncher #770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The fragment of the stack trace you provided does not have any relevant information, so please include the full stack trace |
I am getting the same error when I deploy to GCP. Below is the full stacktrace: Exception in thread "main" java.lang.RuntimeException: Could not construct an instance of org.springframework.cloud.function.adapter.gcp.GcfJarLauncher: java.lang.reflect.InvocationTargetException at com.google.cloud.functions.invoker.HttpFunctionExecutor.forClass(HttpFunctionExecutor.java:57) at com.google.cloud.functions.invoker.runner.Invoker.startServer(Invoker.java:243) at com.google.cloud.functions.invoker.runner.Invoker.main(Invoker.java:121) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.google.cloud.functions.invoker.HttpFunctionExecutor.forClass(HttpFunctionExecutor.java:53) ... 2 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at org.springframework.cloud.function.adapter.gcp.GcfJarLauncher.(GcfJarLauncher.java:48) ... 7 more Caused by: java.lang.NoSuchMethodError: 'void org.springframework.cloud.function.context.FunctionalSpringApplication.setApplicationContextClass(java.lang.Class)' at org.springframework.cloud.function.context.FunctionalSpringApplication.(FunctionalSpringApplication.java:66) at org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer.springApplication(AbstractSpringFunctionAdapterInitializer.java:378) at org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer.initialize(AbstractSpringFunctionAdapterInitializer.java:121) at org.springframework.cloud.function.adapter.gcp.FunctionInvoker.init(FunctionInvoker.java:78) at org.springframework.cloud.function.adapter.gcp.FunctionInvoker.(FunctionInvoker.java:58) ... 12 more |
Also having the same, downloaded the Background Function sample and run
|
Could you try with the latest? #782 should have fixed this. |
Closing it due to the lack of followup from the user on the provided feedback |
Describe the bug
Unable to follow the instructions specified in https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-gcp-http to have the function run locally
Sample
mvn function:run
[ERROR] Could not invoke function: java.lang.RuntimeException: Could not construct an instance of org.springframework.cloud.function.adapter.gcp.GcfJarLauncher: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Could not construct an instance of org.springframework.cloud.function.adapter.gcp.GcfJarLauncher: java.lang.reflect.InvocationTargetException
at com.google.cloud.functions.invoker.NewHttpFunctionExecutor.forClass (NewHttpFunctionExecutor.java:55)
The text was updated successfully, but these errors were encountered: