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:
Caused by: java.lang.NoClassDefFoundError: jakarta/servlet/ServletContext
which means it now requires spring-boot-starter-tomcat which I previously always excluded in the pom.xml. Even if I add it, the errors don't step, I get Field objectMapper in software.amazonaws.example.product.handler.GetProductByIdHandler required a bean of type 'com.fasterxml.jackson.databind.ObjectMapper' that could not be found.
But Jackson dependency is delcared in the pom.xml.
Please either advice what has changed and why or fix those incompatibilities. Thank you!