Closed mmarimuthu closed 6 months ago
@olegz could you please check this.
The issue is that you are using the very old version of spring-cloud-function (3.2.8). It is EOL since late 2023 (https://spring.io/projects/spring-cloud-function#support). Even 4.0.x is EOL for open source. In other words even if ai could fix it we would never have a new release for it unless you are a commercial/paying customer. So, i suggest to upgrade. I'll close it for now. Feel free to raise a new issue after upgrading if problem persists.
@olegz We have upgraded our application to Spring boot 3.2.x and cloud dependencies version to 2023.0.1. Everything seems to be fine. Thanks for your input
the bug Facing errors during runtime of spring cloud function with spring boot 2.7.18 and java 11
Sample Attached a sample application that has the issue. cloud-function.zip
For some reason we cannot upgrade to Spring Boot 3.x
Execution logs:
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _
| \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.7.18)2024-04-02 19:50:42,770 | | INFO | main | lambdainternal.AWSLambda - Starting AWSLambda using Java 11.0.22 on db898079c811 with PID 13 (/var/runtime/lib/aws-lambda-java-runtime-0.2.0.jar started by root in /var/task) 2024-04-02 19:50:42,775 | | INFO | main | lambdainternal.AWSLambda - The following 1 profile is active: "dev" 2024-04-02 19:50:43,271 | | ERROR | main | o.s.b.d.LoggingFailureAnalysisReporter -
APPLICATION FAILED TO START
Description:
Parameter 0 of method awsTypesConverter in org.springframework.cloud.function.adapter.aws.AWSCompanionAutoConfiguration required a bean of type 'org.springframework.cloud.function.json.JsonMapper' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.cloud.function.json.JsonMapper' in your configuration.
Error creating bean with name 'awsTypesConverter' defined in org.springframework.cloud.function.adapter.aws.AWSCompanionAutoConfiguration: Unsatisfied dependency expressed through method 'awsTypesConverter' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.function.json.JsonMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}: org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'awsTypesConverter' defined in org.springframework.cloud.function.adapter.aws.AWSCompanionAutoConfiguration: Unsatisfied dependency expressed through method 'awsTypesConverter' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.function.json.JsonMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:536) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:929) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409) at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) at org.springframework.cloud.function.adapter.aws.FunctionInvoker.start(FunctionInvoker.java:137) at org.springframework.cloud.function.adapter.aws.FunctionInvoker.(FunctionInvoker.java:79)
at org.springframework.cloud.function.adapter.aws.FunctionInvoker.(FunctionInvoker.java:83)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.function.json.JsonMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1801)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1357)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
... 23 more`