0

Getting below error while using Spring web dependency with Spring cloud function(jar running in AWS Lambda). Actually I am trying to make rest api call from lambda(built with spring cloud function) to another micro-service. hence while autowiring RestTemplate and using restTemplate to make POST call I am getting this info in cloudwatch. Not sure what is happening here.

Spring cloud function Verison - 3.2.6

Spring Boot version - 2.7.1

Spring boot web starter version - 2.7.1

    2022-09-21T17:19:48.301Z 5d008227-64e9-516d-a43b-d9822d0dbf46 Task timed out after 15.02 seconds

17:19:48.889 [main] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Searching for start class in manifest: jar:file:/var/runtime/lib/aws-lambda-java-core-1.2.0.jar!/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: adsuresh
Created-By: Apache Maven 3.5.0
Build-Jdk: 1.8.0_144
17:19:48.898 [main] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Searching for start class in manifest: jar:file:/var/runtime/lib/aws-lambda-java-runtime-0.2.0.jar!/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: root
Created-By: Apache Maven 3.6.3
Build-Jdk: 1.8.0_332
17:19:48.899 [main] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Searching for start class in manifest: jar:file:/var/runtime/lib/aws-lambda-java-serialization-0.2.0.jar!/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: root
Created-By: Apache Maven 3.6.3
Build-Jdk: 1.8.0_332
17:19:48.900 [main] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Searching for start class in manifest: jar:file:/var/runtime/lib/org-crac-inmemory-0.1.0.jar!/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: root
Created-By: Apache Maven 3.6.3
Build-Jdk: 1.8.0_332
17:19:48.901 [main] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Searching for start class in manifest: jar:file:/var/runtime/amzn-log4j-security-jdk11-0.1alpha.jar!/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Premain-Class: Log4jPatch
Created-By: 11.0.13 (Amazon.com Inc.)
17:19:48.907 [main] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Searching for start class in manifest: file:/var/task/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Created-By: Maven JAR Plugin 3.2.2
Build-Jdk-Spec: 18
Implementation-Title: alpha
Implementation-Version: 0.0.1-SNAPSHOT
Main-Class: org.springframework.boot.loader.wrapper.ThinJarWrapper
Start-Class: com.phoenix.alpha.AlphaApplication
Spring-Boot-Version: 2.7.1
Spring-Boot-Classes: 
17:19:48.951 [main] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Loaded Start Class: class com.phoenix.alpha.AlphaApplication
17:19:48.951 [main] INFO org.springframework.cloud.function.utils.FunctionClassUtils - Main class: class com.phoenix.alpha.AlphaApplication
  • I am not sure either, but it appears to be some kind of packaging problem. Anyway, the best thing you can do is push a reproducible sample somewhere in Github so we can take a look – Oleg Zhurakousky Sep 22 '22 at 09:19
  • I figured out what I was missing. In this case, I was using lambda to call APIs exposed in a private network hence lambda should have VPC configuration enabled. When I tried with the public network it works like charm. – Chandan Mishra Sep 22 '22 at 09:49

0 Answers0