1

I wrote simple Spring Boot app, added pom copied from spring tutorial and build the jar file. On windows app starts fine but when I open jar on linux (CentOS Linux release 7.2.1511) app freezes on:

...something
2016-04-20 12:10:33.535  INFO 25587 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean        : Mapping servlet: 'dispatcherServlet' to [/]
2016-04-20 12:10:33.543  INFO 25587 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-04-20 12:10:33.544  INFO 25587 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-04-20 12:10:33.544  INFO 25587 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-04-20 12:10:33.544  INFO 25587 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'requestContextFilter' to: [/*]

And it takes about 7-8 minutes to continue. I have hotspot on windows 7 and openjdk on centos. (if it matters)

Linux: java -version
openjdk version "1.8.0_77"
OpenJDK Runtime Environment (build 1.8.0_77-b03)
OpenJDK 64-Bit Server VM (build 25.77-b03, mixed mode)

Windows: java -version
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)

Do you guys have any idea what is the reason? thanks in advance..

azalut
  • 4,094
  • 7
  • 33
  • 46

1 Answers1

4

Workaround found on Atlassian website (not only there)

  • Open the $JAVA_HOME/jre/lib/security/java.security file in a text editor
  • Find the line: securerandom.source=file:/dev/random
  • Change it to read: securerandom.source=file:/dev/urandom
  • Save your change and exit the text editor

Alternative is to run java with argument:

-Djava.security.egd=file:/dev/./urandom
azalut
  • 4,094
  • 7
  • 33
  • 46