-
Notifications
You must be signed in to change notification settings - Fork 636
Description
I have a working example to deploy AWS Lambda using Spring Cloud Function AWS using Java 21, Spring Boot 3.4 and Spring Cloud Function 4.2.0
Now I updated it to use Java 25, Spring Boot 4.0 and Spring Cloud Function 5.0.1, see the code and it fails to start with the error message:
Field objectMapper in software.amazonaws.example.product.handler.CreateProductHandler required a bean of type 'com.fasterxml.jackson.databind.ObjectMapper' that could not be found. | Field objectMapper in software.amazonaws.example.product.handler.CreateProductHandler required a bean of type 'com.fasterxml.jackson.databind.ObjectMapper' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.fasterxml.jackson.databind.ObjectMapper' in your configuration.
Update:
I could fix it by defining:
@Bean
public ObjectMapper objectMapper() {
ObjectMapper mapper = new ObjectMapper();
return mapper;
}
but I atill don't understand why I need to do it with the newer version.