# AWS Lambda ColdStart springboot booting 2 times

**URL:** <https://forum.serverless.com/t/aws-lambda-coldstart-springboot-booting-2-times/5850>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [September 17, 2018, 7:46pm UTC](https://forum.serverless.com/t/aws-lambda-coldstart-springboot-booting-2-times/5850 "2018-09-17T19:46:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanthgs](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@srikanthgs](https://forum.serverless.com/u/srikanthgs)\
**Post date:** [September 17, 2018, 7:46pm UTC](https://forum.serverless.com/t/aws-lambda-coldstart-springboot-booting-2-times/5850/1 "2018-09-17T19:46:20Z")

</div>

2018/09/08 16:00:16 _NO\_REQUEST\_ID_ INFO c.a.s.p.i.LambdaContainerHandler Starting Lambda Container Handler  
2018/09/08 16:00:16 _NO\_REQUEST\_ID_ INFO c.a.s.p.i.s.AwsServletContext 1 Spring WebApplicationInitializers detected on classpath

. \_\_\_\_ \_ \_\_ \_ \_  
/  
/ _’ \_\_ \_ () \_\_ \_\_ \_ \ \ \   
( ( )\__\_ | '\_ | '_| | ’_ / \_` | \ \ \ \

/ _)| |)| | | | | || (| | ) ) ) )  
’ | __| .\_\_|| ||_| |_\__ , | / / / /  
=========|_|==============|__/=//_/\_/  
:: Spring Boot ::

2018/09/08 16:00:18 _NO\_REQUEST\_ID_ INFO c.w.m.p.a.sample Starting Application on ip-10-0-0-0.us-east-1.compute.internal with PID 1 (/var/task started by in /)  
2018/09/08 16:00:18 _NO\_REQUEST\_ID_ INFO c.w.m.p.a.Application No active profile set, falling back to default profiles: default  
2018/09/08 16:00:18 _NO\_REQUEST\_ID_ INFO o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@d70c109: startup date [https://forums.aws.amazon.com/;](https://forums.aws.amazon.com/;) root of context hierarchy  
2018/09/08 16:00:21 _NO\_REQUEST\_ID_ INFO c.a.s.p.i.s.AwsServletContext Initializing Spring embedded WebApplicationContext  
2018/09/08 16:00:21 _NO\_REQUEST\_ID_ INFO o.s.w.c.ContextLoader Root WebApplicationContext: initialization completed in 2827 ms  
2018/09/08 16:00:21 _NO\_REQUEST\_ID_ INFO o.s.b.w.s.ServletRegistrationBean Servlet dispatcherServlet mapped to [/]  
2018/09/08 16:00:21 _NO\_REQUEST\_ID_ INFO c.a.s.p.i.s.AwsServletContext Initializing Spring FrameworkServlet ‘dispatcherServlet’  
2018/09/08 16:00:21 _NO\_REQUEST\_ID_ INFO o.s.w.s.DispatcherServlet FrameworkServlet ‘dispatcherServlet’: initialization started  
2018/09/08 16:00:22 _NO\_REQUEST\_ID_ INFO o.s.w.s.h.SimpleUrlHandlerMapping Mapped URL path [/**/favicon.ico] onto handler of type [http://class org.springframework.web.servlet.resource.ResourceHttpRequestHandler](http://class%20org.springframework.web.servlet.resource.resourcehttprequesthandler/)  
2018/09/08 16:00:22 _NO\_REQUEST\_ID_ INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping Mapped “{[/promoscombos/{petNum}],methods=https://forums.aws.amazon.com/,produces= ~~application/json~~ }” onto public org.springframework.http.ResponseEntity\<com.sample.microservices.samplembos.domain.response.samplembosResponse\> com.sample.microservices.samplembos.controller.samplembosController.getsamplembos(java.lang.String,java.lang.String,java.util.Optional\<java.lang.String\>,java.lang.String,java.lang.String,java.lang.String,java.lang.String)  
2018/09/08 16:00:22 _NO\_REQUEST\_ID_ INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping Mapped “{[/error]}” onto public org.springframework.http.ResponseEntity\<java.util.Map\<java.lang.String, java.lang.Object\>\> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)  
2018/09/08 16:00:22 _NO\_REQUEST\_ID_ INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping Mapped “{[/error],produces= ~~text/html~~ }” onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)  
2018/09/08 16:00:22 _NO\_REQUEST\_ID_ INFO o.s.w.s.h.SimpleUrlHandlerMapping Mapped URL path [/webjars/**] onto handler of type [http://class org.springframework.web.servlet.resource.ResourceHttpRequestHandler](http://class%20org.springframework.web.servlet.resource.resourcehttprequesthandler/)  
2018/09/08 16:00:22 _NO\_REQUEST\_ID_ INFO o.s.w.s.h.SimpleUrlHandlerMapping Mapped URL path [/\*\*] onto handler of type [http://class org.springframework.web.servlet.resource.ResourceHttpRequestHandler](http://class%20org.springframework.web.servlet.resource.resourcehttprequesthandler/)  
2018/09/08 16:00:23 _NO\_REQUEST\_ID_ INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@d70c109: startup date [https://forums.aws.amazon.com/;](https://forums.aws.amazon.com/;) root of context hierarchy  
2018/09/08 16:00:24 _NO\_REQUEST\_ID_ INFO o.s.w.s.DispatcherServlet FrameworkServlet ‘dispatcherServlet’: initialization completed in 2296 ms  
2018/09/08 16:00:24 _NO\_REQUEST\_ID_ INFO o.s.b.w.s.FilterRegistrationBean Mapping filter: ‘characterEncodingFilter’ to: [/_]  
2018/09/08 16:00:24 NO\_REQUEST\_ID INFO o.s.b.w.s.FilterRegistrationBean Mapping filter: ‘errorPageFilter’ to: [/_]  
2018/09/08 16:00:24 _NO\_REQUEST\_ID_ INFO o.s.b.w.s.FilterRegistrationBean Mapping filter: ‘hiddenHttpMethodFilter’ to: [/_]  
2018/09/08 16:00:24 NO\_REQUEST\_ID INFO o.s.b.w.s.FilterRegistrationBean Mapping filter: ‘httpPutFormContentFilter’ to: [/_]  
2018/09/08 16:00:24 _NO\_REQUEST\_ID_ INFO o.s.b.w.s.FilterRegistrationBean Mapping filter: ‘requestContextFilter’ to: [/\*]  
START RequestId: 465261d6-b380-11e8-9a51-e73f81490196 Version: $LATEST  
2018/09/08 16:00:26 _NO\_REQUEST\_ID_ INFO c.a.s.p.i.LambdaContainerHandler Starting Lambda Container Handler  
2018/09/08 16:00:26 _NO\_REQUEST\_ID_ INFO c.a.s.p.i.s.AwsServletContext 1 Spring WebApplicationInitializers detected on classpath

. \_\_\_\_ \_ \_\_ \_ \_  
/  
/ _’ \_\_ \_ () \_\_ \_\_ \_ \ \ \   
( ( )\__\_ | '\_ | '_| | ’_ / \_` | \ \ \ \

/ _)| |)| | | | | || (| | ) ) ) )  
’ | __| .\_\_|| ||_| |_\__ , | / / / /  
=========|_|==============|__/=//_/\_/  
:: Spring Boot ::

2018/09/08 16:00:28 _NO\_REQUEST\_ID_ INFO c.w.m.p.a.Application Starting Application on ip-10-0-0-0.us-east-1.compute.internal with PID 1 (/var/task started by fdd\_user1 in /)  
2018/09/08 16:00:28 _NO\_REQUEST\_ID_ INFO c.w.m.p.a.Application No active profile set, falling back to default profiles: default  
2018/09/08 16:00:28 _NO\_REQUEST\_ID_ INFO o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6956de9: startup date [https://forums.aws.amazon.com/;](https://forums.aws.amazon.com/;) root of context hierarchy  
2018/09/08 16:00:31 _NO\_REQUEST\_ID_ INFO c.a.s.p.i.s.AwsServletContext Initializing Spring embedded WebApplicationContext  
2018/09/08 16:00:31 _NO\_REQUEST\_ID_ INFO o.s.w.c.ContextLoader Root WebApplicationContext: initialization completed in 2775 ms  
2018/09/08 16:00:31 _NO\_REQUEST\_ID_ INFO o.s.b.w.s.ServletRegistrationBean Servlet dispatcherServlet mapped to [/]  
2018/09/08 16:00:32 _NO\_REQUEST\_ID_ INFO c.a.s.p.i.s.AwsServletContext Initializing Spring FrameworkServlet ‘dispatcherServlet’  
2018/09/08 16:00:32 _NO\_REQUEST\_ID_ INFO o.s.w.s.DispatcherServlet FrameworkServlet ‘dispatcherServlet’: initialization started  
2018/09/08 16:00:32 _NO\_REQUEST\_ID_ INFO o.s.w.s.h.SimpleUrlHandlerMapping Mapped URL path [/\*\*/favicon.ico] onto handler of type [http://class org.springframework.web.servlet.resource.ResourceHttpRequestHandler](http://class%20org.springframework.web.servlet.resource.resourcehttprequesthandler/)  
2018/09/08 16:00:32 _NO\_REQUEST\_ID_ INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping Mapped “{[/samplembos/{petNum}],methods=https://forums.aws.amazon.com/,produces= ~~application/json~~ }” onto public org.springframework.http.ResponseEntity\<com.sample.microservices.samplembos.domain.response.samplembosResponse\> com.sample.microservices.samplembos.controller.samplembosController.getsamplembos(java.lang.String,java.lang.String,java.util.Optional\<java.lang.String\>,java.lang.String,java.lang.String,java.lang.String,java.lang.String)  
Below are the Jar files I am using

1\>spring-boot-starter-web  
2\>aws-serverless-java-container-spring  
3\>httpclient  
4\>aws-java-sdk-ssm
