Skip to content

AWS Lambda based on Spring Cloud Function AWS 5.0.1 using Spring Boot 4 fails #1337

@Vadym79

Description

@Vadym79

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions