Spring Boot startup slow on Raspberry PI - performance

Using Spring Boot 2 for an IoT application, I notice that the startup time for Spring is disproportionally slow. The platform is a Raspberry PI 2B - of course, this is going to be significantly slower than a PC. For normal code execution I measure a 20x to 50x difference.
Spring boot startup time on my PC (Win10 x64): 5 seconds
Spring boot startup time on the PI (Ubuntu Server, ARM java in docker running a jar): 11 minutes
If I use the highest factor I've ever measured (50x), I would expect to see a startup time of less than half of the current state. So far, I tried:
Excluding dependencies from auto configuration (now minimal with only only spring-boot-starter-web, kotlin, undertow, webflux, reactor and kafka)
Logging on DEBUG to see what was happening during quiet periods (mostly beans being set up, nothing suspicious, though some beans take several seconds to load)
Different docker image for Java on ARM (no effect)
CPU is consistently at 100%, memory is around 20% and there is plenty of disk space
My preliminary conclusion is that loading beans eats all the CPU cycles. I imagine that initializing a bean should not take several seconds, but it does. What could be the bottleneck here? Can I get Spring to load faster in any way?
Here is the first part of the output from a PC:
2018-01-06 13:43:03.462 INFO 9144 --- [ main] c.e.b.BasestationApplicationKt : Starting BasestationApplicationKt on GPC with PID 9144 (C:\Data\Code\app\git\basestation\out\production\classes started by User in C:\Data\Code\app\git)
2018-01-06 13:43:03.471 INFO 9144 --- [ main] c.e.b.BasestationApplicationKt : The following profiles are active: dev
2018-01-06 13:43:03.637 INFO 9144 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#294e5088: startup date [Sat Jan 06 13:43:03 CET 2018]; root of context hierarchy
2018-01-06 13:43:05.578 INFO 9144 --- [ main] org.xnio : XNIO version 3.3.8.Final
2018-01-06 13:43:05.600 INFO 9144 --- [ main] org.xnio.nio : XNIO NIO Implementation Version 3.3.8.Final
2018-01-06 13:43:05.695 WARN 9144 --- [ main] io.undertow.websockets.jsr : UT026009: XNIO worker was not set on WebSocketDeploymentInfo, the default worker will be used
2018-01-06 13:43:05.695 WARN 9144 --- [ main] io.undertow.websockets.jsr : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2018-01-06 13:43:05.721 INFO 9144 --- [ main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext
2018-01-06 13:43:05.722 INFO 9144 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2088 ms
2018-01-06 13:43:05.851 INFO 9144 --- [ main] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2018-01-06 13:43:05.857 INFO 9144 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-01-06 13:43:07.323 INFO 9144 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[GET]}" onto public com.app.basestation.model.Message com.app.basestation.BasestationController.home()
2018-01-06 13:43:07.330 INFO 9144 --- [ main] 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-01-06 13:43:07.349 INFO 9144 --- [ main] 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-01-06 13:43:07.509 INFO 9144 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#294e5088: startup date [Sat Jan 06 13:43:03 CET 2018]; root of context hierarchy
2018-01-06 13:43:08.519 INFO 9144 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-01-06 13:43:08.553 INFO 9144 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647
2018-01-06 13:43:08.678 INFO 9144 --- [ main] o.s.b.w.e.u.UndertowServletWebServer : Undertow started on port(s) 11112 (http)
And the output from the PI:
2018-01-06 12:48:41.689 INFO 1 --- [ main] c.e.b.BasestationApplicationKt : Starting BasestationApplicationKt on ubuntu with PID 1 (/app.jar started by root in /)
2018-01-06 12:48:42.019 INFO 1 --- [ main] c.e.b.BasestationApplicationKt : The following profiles are active: prd
2018-01-06 12:48:49.827 INFO 1 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#128c152: startup date [Sat Jan 06 12:48:49 UTC 2018]; root of context hierarchy
2018-01-06 12:54:05.276 INFO 1 --- [ main] org.xnio : XNIO version 3.3.8.Final
2018-01-06 12:54:08.404 INFO 1 --- [ main] org.xnio.nio : XNIO NIO Implementation Version 3.3.8.Final
2018-01-06 12:54:15.847 WARN 1 --- [ main] io.undertow.websockets.jsr : UT026009: XNIO worker was not set on WebSocketDeploymentInfo, the default worker will be used
2018-01-06 12:54:15.852 WARN 1 --- [ main] io.undertow.websockets.jsr : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2018-01-06 12:54:19.930 INFO 1 --- [ main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext
2018-01-06 12:54:19.934 INFO 1 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 330155 ms
2018-01-06 12:54:42.544 INFO 1 --- [ main] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2018-01-06 12:54:43.206 INFO 1 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-01-06 12:57:18.683 INFO 1 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[GET]}" onto public com.app.basestation.model.Message com.app.basestation.BasestationController.home()
2018-01-06 12:57:19.734 INFO 1 --- [ main] 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-01-06 12:57:19.758 INFO 1 --- [ main] 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-01-06 12:57:44.597 INFO 1 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#128c152: startup date [Sat Jan 06 12:48:49 UTC 2018]; root of context hierarchy
2018-01-06 12:59:36.677 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-01-06 12:59:37.807 INFO 1 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647
2018-01-06 12:59:42.664 INFO 1 --- [ main] o.s.b.w.e.u.UndertowServletWebServer : Undertow started on port(s) 11112 (http)

Update:
For those reading this, I moved back to OpenJDK in 2019 due to the new Oracle policies. What I noticed is that OpenJDK has made significant performance improvements recently. If you use OpenJDK 11 and above, it has similar performance to Oracle JDK and you can easily configure its language level to work with Java 8 code. That said, if this does not work for you, try the below.
I moved to a new image: Oracle JDK instead of OpenJDK as #snodnipper suggested.
There were several things I had to do including installing a more recent version of Java 8 than the one available in the standard repository. This is the Dockerfile that ended up working for me, and now the application starts in 2 minutes.
FROM resin/raspberrypi3-buildpack-deps:jessie-scm
ENV LANG C.UTF-8
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
RUN ["cross-build-start"]
RUN echo "deb http://archive.raspberrypi.org/debian/ jessie main ui staging" > /etc/apt/sources.list.d/raspi.list
RUN rm -f /usr/bin/entry.sh
RUN wget -qO - http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | apt-key add -
RUN { \
echo '#!/bin/bash'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home && \
chmod +x /usr/local/bin/docker-java-home
RUN apt-key adv --recv-key --keyserver keyserver.ubuntu.com C2518248EEA14886 && \
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" >> /etc/apt/sources.list.d/raspi.list
RUN set -x && \
apt-get update && \
apt-cache madison oracle-java8-installer && \
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
apt-get install -y oracle-java8-installer oracle-java8-set-default && \
rm -rf /var/lib/apt/lists/* && \
[ "$JAVA_HOME" = "$(docker-java-home)" ]
RUN [ "cross-build-end" ]
ADD build/libs/app-0.0.1-SNAPSHOT.jar /app.jar
ENV JAVA_OPTS=""
ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar

Related

Spring boot: I am getting whitelabel error pae instead of view

I am writing spring boot application with spring MVC and H2 in memory database. I have a controller with mapping /posts on findAllPosts() method which returns post.jsp view. But when i run application and hit localhost:8080/posts it shows error page. In console it also shows mapping done for /posts.
Controller class-
package com.H2DatabaseDemo.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.H2DatabaseDemo.model.Post;
import com.H2DatabaseDemo.services.PostService;
#Controller
public class H2DemoController {
#Autowired
private PostService postService;
#RequestMapping("/posts")
public String findAllPost(Model model)
{
List<Post> thePosts=postService.findAllPost();
model.addAttribute("posts",thePosts);
return "posts";
}
}
Appication class-
package com.H2DatabaseDemo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
#SpringBootApplication
public class H2DatabaseDemoApplication {
public static void main(String[] args) {
SpringApplication.run(H2DatabaseDemoApplication.class, args);
}
}
property file-
spring.h2.console.enabled=true
spring.h2.console.path=/console
spring.datasource.url=jdbc:h2:mem:h2demo-app
spring.mvc.view.prefix: /WEB-INF/view/
spring.mvc.view.suffix: .jsp
stack trace-
:: Spring Boot :: (v2.0.4.RELEASE)
2018-09-16 09:19:50.379 INFO 12868 --- [ main] c.H.H2DatabaseDemoApplication : Starting H2DatabaseDemoApplication on DESKTOP-7NILS0D with PID 12868 (D:\springCourse\H2DatabaseDemo\target\classes started by Mrugesh in D:\springCourse\H2DatabaseDemo)
2018-09-16 09:19:50.384 INFO 12868 --- [ main] c.H.H2DatabaseDemoApplication : No active profile set, falling back to default profiles: default
2018-09-16 09:19:50.459 INFO 12868 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#3d299e3: startup date [Sun Sep 16 09:19:50 IST 2018]; root of context hierarchy
2018-09-16 09:19:52.000 INFO 12868 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$74090544] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-09-16 09:19:52.796 INFO 12868 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-09-16 09:19:52.833 INFO 12868 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-09-16 09:19:52.834 INFO 12868 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.32
2018-09-16 09:19:52.849 INFO 12868 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_171\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_171/bin/server;C:/Program Files/Java/jre1.8.0_171/bin;C:/Program Files/Java/jre1.8.0_171/lib/amd64;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\nodejs\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Microsoft VS Code\bin;C:\Users\Mrugesh\AppData\Roaming\npm;C:\Users\Mrugesh\AppData\Local\Microsoft\WindowsApps;C:\Users\Mrugesh\AppData\Local\GitHubDesktop\bin;C:\eclipse;;.]
2018-09-16 09:19:53.018 INFO 12868 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-09-16 09:19:53.018 INFO 12868 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2562 ms
2018-09-16 09:19:53.160 INFO 12868 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-09-16 09:19:53.162 INFO 12868 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet webServlet mapped to [/console/*]
2018-09-16 09:19:53.167 INFO 12868 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-09-16 09:19:53.167 INFO 12868 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-09-16 09:19:53.168 INFO 12868 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-09-16 09:19:53.168 INFO 12868 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-09-16 09:19:53.408 INFO 12868 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2018-09-16 09:19:53.806 INFO 12868 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2018-09-16 09:19:53.876 INFO 12868 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2018-09-16 09:19:53.905 INFO 12868 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2018-09-16 09:19:54.036 INFO 12868 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.2.17.Final}
2018-09-16 09:19:54.038 INFO 12868 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2018-09-16 09:19:54.085 INFO 12868 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-09-16 09:19:54.280 INFO 12868 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2018-09-16 09:19:54.962 INFO 12868 --- [ main] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl#93824eb'
2018-09-16 09:19:54.965 INFO 12868 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2018-09-16 09:19:55.623 INFO 12868 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-09-16 09:19:55.918 INFO 12868 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#3d299e3: startup date [Sun Sep 16 09:19:50 IST 2018]; root of context hierarchy
2018-09-16 09:19:55.974 WARN 12868 --- [ main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2018-09-16 09:19:56.017 INFO 12868 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/posts]}" onto public java.lang.String com.H2DatabaseDemo.controller.H2DemoController.findAllPost(org.springframework.ui.Model)
2018-09-16 09:19:56.027 INFO 12868 --- [ main] 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-16 09:19:56.028 INFO 12868 --- [ main] 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-16 09:19:56.060 INFO 12868 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-09-16 09:19:56.060 INFO 12868 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-09-16 09:19:56.366 INFO 12868 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-09-16 09:19:56.370 INFO 12868 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure
2018-09-16 09:19:56.378 INFO 12868 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]
2018-09-16 09:19:56.610 INFO 12868 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-09-16 09:19:56.614 INFO 12868 --- [ main] c.H.H2DatabaseDemoApplication : Started H2DatabaseDemoApplication in 6.721 seconds (JVM running for 7.372)
2018-09-16 09:20:06.742 INFO 12868 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2018-09-16 09:20:06.742 INFO 12868 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2018-09-16 09:20:06.884 INFO 12868 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 142 ms
2018-09-16 09:20:07.138 INFO 12868 --- [nio-8080-exec-1] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
Over the controller method add RequestMapping("/")
Please add these dependencies in your pom.xml
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>

Intellij Springboot problems on startup

I am really new with spring boot, so I started with some tutorials to create a simple Rest example (my final goal is to integrate it with mongodb, but I need to start!).
I created a new project on IntelliJ with Spring Initializr and choosed Web and Mongodb as features.
Then I added only a class,
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
#RestController
public class HelloController {
#RequestMapping("/")
public String index() {
return "Greetings from Spring Boot!";
}
}
When I run the project, the console is
2018-09-03 20:08:33.139 INFO 1363 --- [ main]
test.test.TestApplication : Starting TestApplication on
MacBook-Pro-di-Stefano.local with PID 1363
(/Users/stefanomiceli/IdeaProjects/test/target/classes started by
stefanomiceli in /Users/stefanomiceli/IdeaProjects/test)
2018-09-03 20:08:33.141 INFO 1363 --- [ main]
test.test.TestApplication : No active profile set,
falling back to default profiles: default
2018-09-03 20:08:33.173 INFO 1363 --- [ main]
ConfigServletWebServerApplicationContext : Refreshing
org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#15713d56: startup date [Mon Sep 03 20:08:33 PDT 2018]; root of context hierarchy
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by
org.springframework.cglib.core.ReflectUtils$1
(file:/Users/stefanomiceli/.m2/repository/org/springframework/spring-
core/5.0.8.RELEASE/spring-core-5.0.8.RELEASE.jar) to method
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of
org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further
illegal reflective access operations
WARNING: All illegal access operations will be denied in a future
release
2018-09-03 20:08:33.950 INFO 1363 --- [ main]
o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with
port(s): 8080 (http)
2018-09-03 20:08:33.969 INFO 1363 --- [ main]
o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-09-03 20:08:33.969 INFO 1363 --- [ main]
org.apache.catalina.core.StandardEngine : Starting Servlet Engine:
Apache Tomcat/8.5.32
2018-09-03 20:08:33.972 INFO 1363 --- [ost-startStop-1]
o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat
Native library which allows optimal performance in production
environments was not found on the java.library.path:
[/Users/stefanomiceli/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-09-03 20:08:34.021 INFO 1363 --- [ost-startStop-1] o.a.c.c.C.
[Tomcat].[localhost].[/] : Initializing Spring embedded
WebApplicationContext
2018-09-03 20:08:34.021 INFO 1363 --- [ost-startStop-1]
o.s.web.context.ContextLoader : Root WebApplicationContext:
initialization completed in 852 ms
2018-09-03 20:08:34.059 INFO 1363 --- [ost-startStop-1]
o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet
mapped to [/]
2018-09-03 20:08:34.061 INFO 1363 --- [ost-startStop-1]
o.s.b.w.servlet.FilterRegistrationBean : Mapping filter:
'characterEncodingFilter' to: [/*]
2018-09-03 20:08:34.062 INFO 1363 --- [ost-startStop-1]
o.s.b.w.servlet.FilterRegistrationBean : Mapping filter:
'hiddenHttpMethodFilter' to: [/*]
2018-09-03 20:08:34.062 INFO 1363 --- [ost-startStop-1]
o.s.b.w.servlet.FilterRegistrationBean : Mapping filter:
'httpPutFormContentFilter' to: [/*]
2018-09-03 20:08:34.062 INFO 1363 --- [ost-startStop-1]
o.s.b.w.servlet.FilterRegistrationBean : Mapping filter:
'requestContextFilter' to: [/*]
2018-09-03 20:08:34.143 INFO 1363 --- [ main]
o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path
[/**/favicon.ico] onto handler of type [class
org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-09-03 20:08:34.310 INFO 1363 --- [ main]
s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for
#ControllerAdvice:
org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#15713d56: startup date [Mon Sep 03 20:08:33 PDT 2018]; root of context hierarchy
2018-09-03 20:08:34.344 INFO 1363 --- [ main]
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-03 20:08:34.345 INFO 1363 --- [ main]
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-03 20:08:34.362 INFO 1363 --- [ main]
o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path
[/webjars/**] onto handler of type [class
org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-09-03 20:08:34.362 INFO 1363 --- [ main]
o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto
handler of type [class
org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-09-03 20:08:34.550 INFO 1363 --- [ main]
org.mongodb.driver.cluster : Cluster created with
settings {hosts=[localhost:27017], mode=SINGLE,
requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms',
maxWaitQueueSize=500}
2018-09-03 20:08:34.582 INFO 1363 --- [localhost:27017]
org.mongodb.driver.connection : Opened connection
[connectionId{localValue:1, serverValue:55}] to localhost:27017
2018-09-03 20:08:34.585 INFO 1363 --- [localhost:27017]
org.mongodb.driver.cluster : Monitor thread successfully
connected to server with description
ServerDescription{address=localhost:27017, type=STANDALONE,
state=CONNECTED, ok=true, version=ServerVersion{versionList=[4, 0,
1]}, minWireVersion=0, maxWireVersion=7, maxDocumentSize=16777216,
logicalSessionTimeoutMinutes=30, roundTripTimeNanos=1582641}
2018-09-03 20:08:34.739 INFO 1363 --- [ main]
o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX
exposure on startup
2018-09-03 20:08:34.768 INFO 1363 --- [ main]
o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s):
8080 (http) with context path ''
2018-09-03 20:08:34.772 INFO 1363 --- [ main]
test.test.TestApplication : Started TestApplication in
1.834 seconds (JVM running for 7.413)
But when I go on localhost:8080/ I get 404 error. What did I do wrong in my helloworld? Is there anything that should I make before running the application?
You need to either
Fix the project structure in order to place the Application Entry Point (TestApplication in this case) in the base package (see image below).
Or use #ComponentScan like this (not recommended):
#SpringBootApplication
#ComponentScan("prova") // add the names of the packages where the controllers, services, repositories, etc, are going to be stored.
public class TestApplication {
public static void main(String[] args) {
SpringApplication.run(TestApplication.class, args);
}
}
Your package structure is wrong:
prova.HelloController
test.test.TestApplication
The HelloController must be on the same level or below TestApplication.
You can do it 2 ways.
1.(preferable) Your controller package naming should be test.test.prova
i.e. Your springboot application should follow the package naming structure of Main class.
e.g. If your Main class has package name = com.test, so the controller package name should be com.test.controller
Another way is adding #ComponentScan to your Main class.
e.g.#SpringBootApplication
#ComponentScan("prova")

SpringBoot 2.0 VERY slow to start up on MacOS Sierra

Has anyone experienced a very slow startup time for SpringBoot 2.0 on MacOS Sierra?
My pom is nothing more than this (snippet):
...
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
...
It takes 22 seconds to start up:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.0.RELEASE)
2018-03-13 23:24:58.160 INFO 20517 --- [ main] jekyll.publisher.ServerApplication : Starting ServerApplication on MacBook-Pro.local with PID 20517 (/Users/workspace/jekyll-publisher/target/classes started by xxxx in /Users/workspace/jekyll-publisher)
2018-03-13 23:24:58.163 INFO 20517 --- [ main] jekyll.publisher.ServerApplication : No active profile set, falling back to default profiles: default
2018-03-13 23:24:58.190 INFO 20517 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#8909f18: startup date [Tue Mar 13 23:24:58 EDT 2018]; root of context hierarchy
2018-03-13 23:24:58.736 INFO 20517 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-03-13 23:24:58.748 INFO 20517 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-03-13 23:24:58.749 INFO 20517 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.28
2018-03-13 23:24:58.752 INFO 20517 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-03-13 23:24:58.795 INFO 20517 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-03-13 23:24:58.795 INFO 20517 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 607 ms
2018-03-13 23:24:58.878 INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-03-13 23:24:58.879 INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-03-13 23:24:58.879 INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-03-13 23:24:58.879 INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-03-13 23:24:58.879 INFO 20517 --- [ost-startStop-1] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2018-03-13 23:24:58.880 INFO 20517 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-03-13 23:24:58.902 INFO 20517 --- [ main] j.publisher.web.ping.PingController : Ping on the server was successful.
2018-03-13 23:24:59.044 INFO 20517 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#8909f18: startup date [Tue Mar 13 23:24:58 EDT 2018]; root of context hierarchy
2018-03-13 23:24:59.081 INFO 20517 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[POST],produces=[text/html]}" onto public java.lang.String jekyll.publisher.web.error.ForwardingErrorController.forwardOnError()
2018-03-13 23:24:59.084 INFO 20517 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/ping],methods=[GET]}" onto public jekyll.publisher.web.ping.PingResponse jekyll.publisher.web.ping.PingController.ping(javax.servlet.http.HttpSession)
2018-03-13 23:24:59.103 INFO 20517 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-13 23:24:59.104 INFO 20517 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-13 23:24:59.123 INFO 20517 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-13 23:24:59.134 INFO 20517 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]
2018-03-13 23:24:59.225 INFO 20517 --- [ main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 8edea141-84e2-4ab5-b799-0cf09c464b53
2018-03-13 23:24:59.324 INFO 20517 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher#1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#6813a331, org.springframework.security.web.context.SecurityContextPersistenceFilter#22df874e, org.springframework.security.web.header.HeaderWriterFilter#377c68c6, org.springframework.security.web.csrf.CsrfFilter#3961a41a, org.springframework.security.web.authentication.logout.LogoutFilter#537b32ef, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#607b2792, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#261d8190, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#99a65d3, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#5bdaf2ce, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#778ca8ef, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#1bd81830, org.springframework.security.web.session.SessionManagementFilter#238ad8c, org.springframework.security.web.access.ExceptionTranslationFilter#7d0332e1, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#76adb233]
2018-03-13 23:24:59.373 INFO 20517 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-03-13 23:24:59.406 INFO 20517 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-03-13 23:24:59.409 INFO 20517 --- [ main] jekyll.publisher.ServerApplication : Started ServerApplication in 16.429 seconds (JVM running for 22.012)
Any ideas?
Ok, StackOverflow is making me add "more details". Not sure what else to add here.
Ok, figured it out. It had nothing to do with Spring Boot 2.0. Just happened to coincide with that upgrade.
The real answer is from this StackOverflow:
Maven with Surefire (TestNG) is slow after update to MacOS Sierra
Set it like this
open your terminal and run hostname
$ hostname
xxx.local
modify the host config in file /etc/hosts
127.0.0.1 localhost xxx.local
::1 localhost xxx.local

How to automatically initizlize the 'dispatcherServlet' the moment after the web app started in the spring boot application?

I am working on feign client with hystrix in a spring boot application. I started a eureka server and register two providers. In the feign client application I added the hystrix support. And when I request the service first time, I got the hystrix result, but after that every request could get the expected result from the provider. From the log, I see that the dispatcherServlet was lazily initialized after the first requested was made, not after the web app started. And this extends the timeout span of the hystrix. In this case, I always get the false result on the first request because of the lazy initialization of dispatcherServlet.
How could I get the first request correctly?
Is it ok to initialize
the dispatcherServet the moment after the web starts? If so,
how can I do it?
log:
:: Spring Boot :: (v1.4.0.RELEASE)
2016-10-13 15:06:03.677 INFO 41459 --- [ main] c.i.c.s.MovieFeignHystrixApplication : No active profile set, falling back to default profiles: default
2016-10-13 15:06:03.723 INFO 41459 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#2e6a5539: startup date [Thu Oct 13 15:06:03 CST 2016]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#6e509ffa
2016-10-13 15:06:05.005 INFO 41459 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'hystrixFeature' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration$HystrixWebConfiguration; factoryMethodName=hystrixFeature; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/cloud/netflix/hystrix/HystrixCircuitBreakerConfiguration$HystrixWebConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration; factoryMethodName=hystrixFeature; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/cloud/netflix/hystrix/HystrixCircuitBreakerConfiguration.class]]
2016-10-13 15:06:05.431 WARN 41459 --- [ main] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance #Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static #Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2016-10-13 15:06:05.705 INFO 41459 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=cc11fab8-4eec-3228-9e14-ac8a7dca16b2
2016-10-13 15:06:05.730 INFO 41459 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2016-10-13 15:06:06.367 INFO 41459 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$76aeae65] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-10-13 15:06:07.056 INFO 41459 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8022 (http)
2016-10-13 15:06:07.078 INFO 41459 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-10-13 15:06:07.079 INFO 41459 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.4
2016-10-13 15:06:07.266 INFO 41459 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-10-13 15:06:07.267 INFO 41459 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3544 ms
2016-10-13 15:06:07.883 INFO 41459 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-10-13 15:06:07.902 INFO 41459 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'metricFilter' to: [/*]
2016-10-13 15:06:07.903 INFO 41459 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-10-13 15:06:07.903 INFO 41459 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-10-13 15:06:07.903 INFO 41459 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-10-13 15:06:07.903 INFO 41459 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2016-10-13 15:06:07.903 INFO 41459 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webRequestLoggingFilter' to: [/*]
2016-10-13 15:06:07.904 INFO 41459 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'applicationContextIdFilter' to: [/*]
2016-10-13 15:06:08.071 INFO 41459 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#140d1230: startup date [Thu Oct 13 15:06:08 CST 2016]; parent: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#2e6a5539
2016-10-13 15:06:08.111 INFO 41459 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2016-10-13 15:06:09.841 WARN 41459 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2016-10-13 15:06:09.842 INFO 41459 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2016-10-13 15:06:09.857 INFO 41459 --- [ main] c.netflix.config.DynamicPropertyFactory : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration#631cb129
2016-10-13 15:06:10.026 INFO 41459 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#2e6a5539: startup date [Thu Oct 13 15:06:03 CST 2016]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#6e509ffa
2016-10-13 15:06:10.240 INFO 41459 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/feign/{id}],methods=[GET]}" onto public com.itmuch.cloud.study.user.entity.User com.itmuch.cloud.study.user.controller.FeignHystrixController.findByIdFeign(java.lang.Long)
2016-10-13 15:06:10.244 INFO 41459 --- [ main] 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.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-10-13 15:06:10.245 INFO 41459 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2016-10-13 15:06:10.383 INFO 41459 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-10-13 15:06:10.383 INFO 41459 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-10-13 15:06:10.468 INFO 41459 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-10-13 15:06:11.460 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2016-10-13 15:06:11.461 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env || /env.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.462 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/hystrix.stream/**]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.cloud.netflix.endpoint.ServletWrappingEndpoint.handle(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception
2016-10-13 15:06:11.464 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.467 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.467 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/refresh || /refresh.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
2016-10-13 15:06:11.468 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/resume || /resume.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
2016-10-13 15:06:11.470 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/pause || /pause.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
2016-10-13 15:06:11.471 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.474 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2016-10-13 15:06:11.475 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/health || /health.json],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(java.security.Principal)
2016-10-13 15:06:11.476 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/info || /info.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.479 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/restart || /restart.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.context.restart.RestartMvcEndpoint.invoke()
2016-10-13 15:06:11.480 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2016-10-13 15:06:11.480 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.506 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.529 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/archaius || /archaius.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.562 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.563 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.value(java.util.Map<java.lang.String, java.lang.String>)
2016-10-13 15:06:11.566 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env/reset],methods=[POST]}" onto public java.util.Map<java.lang.String, java.lang.Object> org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.reset()
2016-10-13 15:06:11.580 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/features || /features.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.581 INFO 41459 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2016-10-13 15:06:11.911 WARN 41459 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2016-10-13 15:06:11.911 INFO 41459 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2016-10-13 15:06:12.096 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-10-13 15:06:12.118 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'refreshScope' has been autodetected for JMX exposure
2016-10-13 15:06:12.122 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'environmentManager' has been autodetected for JMX exposure
2016-10-13 15:06:12.129 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure
2016-10-13 15:06:12.132 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'refreshEndpoint' has been autodetected for JMX exposure
2016-10-13 15:06:12.134 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'restartEndpoint' has been autodetected for JMX exposure
2016-10-13 15:06:12.139 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'environmentManager': registering with JMX server as MBean [org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager]
2016-10-13 15:06:12.373 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'restartEndpoint': registering with JMX server as MBean [org.springframework.cloud.context.restart:name=restartEndpoint,type=RestartEndpoint]
2016-10-13 15:06:12.394 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'refreshScope': registering with JMX server as MBean [org.springframework.cloud.context.scope.refresh:name=refreshScope,type=RefreshScope]
2016-10-13 15:06:12.412 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,context=2e6a5539,type=ConfigurationPropertiesRebinder]
2016-10-13 15:06:12.427 INFO 41459 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'refreshEndpoint': registering with JMX server as MBean [org.springframework.cloud.endpoint:name=refreshEndpoint,type=RefreshEndpoint]
2016-10-13 15:06:12.720 INFO 41459 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2016-10-13 15:06:12.741 INFO 41459 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2016-10-13 15:06:13.225 INFO 41459 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2016-10-13 15:06:13.228 INFO 41459 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2016-10-13 15:06:13.462 INFO 41459 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2016-10-13 15:06:13.462 INFO 41459 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2016-10-13 15:06:13.838 INFO 41459 --- [ main] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2016-10-13 15:06:13.892 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false
2016-10-13 15:06:13.892 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
2016-10-13 15:06:13.892 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2016-10-13 15:06:13.892 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false
2016-10-13 15:06:13.892 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2016-10-13 15:06:13.893 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2016-10-13 15:06:13.893 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2016-10-13 15:06:14.350 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : The response status is 200
2016-10-13 15:06:14.353 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 30
2016-10-13 15:06:14.356 INFO 41459 --- [ main] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
2016-10-13 15:06:14.362 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1476342374362 with initial instances count: 3
2016-10-13 15:06:14.477 INFO 41459 --- [ main] c.n.e.EurekaDiscoveryClientConfiguration : Registering application microservice-consumer-movie-feign-with-hystrix-stream with eureka with status UP
2016-10-13 15:06:14.478 INFO 41459 --- [ main] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1476342374477, current=UP, previous=STARTING]
2016-10-13 15:06:14.479 INFO 41459 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_MICROSERVICE-CONSUMER-MOVIE-FEIGN-WITH-HYSTRIX-STREAM/10.106.192.57:microservice-consumer-movie-feign-with-hystrix-stream:8022: registering service...
2016-10-13 15:06:14.542 INFO 41459 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_MICROSERVICE-CONSUMER-MOVIE-FEIGN-WITH-HYSTRIX-STREAM/10.106.192.57:microservice-consumer-movie-feign-with-hystrix-stream:8022 - registration status: 204
2016-10-13 15:06:14.548 INFO 41459 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647
2016-10-13 15:06:14.555 INFO 41459 --- [ main] ration$HystrixMetricsPollerConfiguration : Starting poller
2016-10-13 15:06:14.661 INFO 41459 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8022 (http)
2016-10-13 15:06:14.662 INFO 41459 --- [ main] c.n.e.EurekaDiscoveryClientConfiguration : Updating port to 8022
2016-10-13 15:06:14.668 INFO 41459 --- [ main] c.i.c.s.MovieFeignHystrixApplication : Started MovieFeignHystrixApplication in 14.338 seconds (JVM running for 15.302)
2016-10-13 15:06:59.127 INFO 41459 --- [nio-8022-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2016-10-13 15:06:59.128 INFO 41459 --- [nio-8022-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2016-10-13 15:06:59.202 INFO 41459 --- [nio-8022-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 74 ms
2016-10-13 15:07:00.304 INFO 41459 --- [provider-user-1] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#353c426d: startup date [Thu Oct 13 15:07:00 CST 2016]; parent: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#2e6a5539
2016-10-13 15:07:00.407 INFO 41459 --- [provider-user-1] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2016-10-13 15:07:00.827 INFO 41459 --- [provider-user-1] c.netflix.config.ChainedDynamicProperty : Flipping property: microservice-provider-user.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2016-10-13 15:07:00.882 INFO 41459 --- [provider-user-1] c.n.u.concurrent.ShutdownEnabledTimer : Shutdown hook installed for: NFLoadBalancer-PingTimer-microservice-provider-user
2016-10-13 15:07:00.944 INFO 41459 --- [provider-user-1] c.netflix.loadbalancer.BaseLoadBalancer : Client:microservice-provider-user instantiated a LoadBalancer:DynamicServerListLoadBalancer:{NFLoadBalancer:name=microservice-provider-user,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
2016-10-13 15:07:00.953 INFO 41459 --- [provider-user-1] c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater
2016-10-13 15:07:00.993 INFO 41459 --- [provider-user-1] c.netflix.config.ChainedDynamicProperty : Flipping property: microservice-provider-user.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2016-10-13 15:07:00.996 INFO 41459 --- [provider-user-1] c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client microservice-provider-user initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=microservice-provider-user,current list of Servers=[10.106.192.57:8001, 10.106.192.57:8000],Load balancer stats=Zone stats: {defaultzone=[Zone:defaultzone; Instance count:2; Active connections count: 0; Circuit breaker tripped count: 0; Active connections per server: 0.0;]
},Server stats: [[Server:10.106.192.57:8001; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 08:00:00 CST 1970; First connection made: Thu Jan 01 08:00:00 CST 1970; Active Connections:0; total failure count in last (1000) msecs:0; average resp time:0.0; 90 percentile resp time:0.0; 95 percentile resp time:0.0; min resp time:0.0; max resp time:0.0; stddev resp time:0.0]
, [Server:10.106.192.57:8000; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 08:00:00 CST 1970; First connection made: Thu Jan 01 08:00:00 CST 1970; Active Connections:0; total failure count in last (1000) msecs:0; average resp time:0.0; 90 percentile resp time:0.0; 95 percentile resp time:0.0; min resp time:0.0; max resp time:0.0; stddev resp time:0.0]
]}ServerList:org.springframework.cloud.netflix.ribbon.eureka.DomainExtractingServerList#14ee3ae0
2016-10-13 15:07:01.302 INFO 41459 --- [ HystrixTimer-1] FeignHystrixClient$HystrixClientFallback : 异常发生,进入fallback方法,接收的参数:id = 4
2009########
2016-10-13 15:07:01.959 INFO 41459 --- [erListUpdater-0] c.netflix.config.ChainedDynamicProperty : Flipping property: microservice-provider-user.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
Thanks.
I add this config hystrix.command.default.execution.timeout.enabled=false
in the application.yml, and it worked. And there is a similar solution here.Initial Request with Feign, Ribbon, Hystrix, and Consul Fails
Another solution is add config: spring.mvc.servlet.load-on-startup: 1. But this time, it still could turn on the hystrix rule to return false result.

Spring Boot not starting on Digital Ocean

I have a Droplet running Ubuntu with Java JDK 1.8 installed. I have transferred my spring boot fat jar. I can execute it no problems on my local machine. On Digital Ocean, it hangs as seen below indefinitely. I just upgraded the memory from 512MB to 1GB and same issue.
2016-09-02 22:02:13.010 INFO 2529 --- [ main] com.example.Application : Starting Application v1.0-SNAPSHOT on restfulProducts with PID 2529 (/home/aaron/restApp/springboot-1.0-SNAPSHOT.jar started by aaron in /home/aaron/restApp)
2016-09-02 22:02:13.022 INFO 2529 --- [ main] com.example.Application : No active profile set, falling back to default profiles: default
2016-09-02 22:02:13.250 INFO 2529 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#736e9adb: startup date [Fri Sep 02 22:02:13 UTC 2016]; root of context hierarchy
2016-09-02 22:02:16.880 INFO 2529 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$41018882] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-09-02 22:02:18.233 INFO 2529 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2016-09-02 22:02:18.280 INFO 2529 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-09-02 22:02:18.283 INFO 2529 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.4
2016-09-02 22:02:18.512 INFO 2529 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-09-02 22:02:18.512 INFO 2529 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 5271 ms
2016-09-02 22:02:18.948 INFO 2529 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-09-02 22:02:18.957 INFO 2529 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-09-02 22:02:18.958 INFO 2529 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-09-02 22:02:18.958 INFO 2529 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-09-02 22:02:18.958 INFO 2529 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
Fateddy's suggestion did not work, however it identified the correct problem; low entropy. The https://www.digitalocean.com/community/tutorials/how-to-setup-additional-entropy-for-cloud-servers-using-haveged which uses haveged worked perfectly.

Resources