0

I'm fighting with a strange problem for a couple of days now and I am ready to give up and move to different VPS provider.

In short, spring boot with tomcat (both jar or CLI) is not starting properly on CentOS 7 (DigitalOcean). No errors, but it does not get to the listening part.

Some context:

  • Fresh VPS with CentOS 7 on DigitalOcean
  • I have tried openjdk 7/8, oracle jdk 7/8 - same result
  • tried both with a "fat" jar and using cli (spring run a.groovy)
  • I suspect it's related to multiple network cards and/or IPV6
  • I have tried java -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses -jar a.jar --server.address=IP
  • Works with embedded Jetty!
  • tomcat 7/8 (both yum and direct downloaded) standalone works fine
  • same thing works on my local machine (I use CentOS 7 too)
  • same thing works on Linode VPS (different kernel and ifconfig though)
  • DigitalOcean support tried to help, but it's a "software" issue

Please see below a few samples:

a.groovy

@RestController
class WebApplication {
    @RequestMapping("/")
    String home() {
        "Hello World!"
    }
}

log output from spring run a.groovy -v

2016-01-16 03:23:20.731  INFO 19507 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-01-16 03:23:20.732  INFO 19507 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-01-16 03:23:20.732  INFO 19507 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-01-16 03:23:20.732  INFO 19507 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'requestContextFilter' to: [/*]
2016-01-16 03:23:20.732 DEBUG 19507 --- [ost-startStop-1] o.apache.catalina.core.StandardContext   : Configuring application event listeners
2016-01-16 03:23:20.732 DEBUG 19507 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       :  Configuring event listener class 'org.apache.tomcat.websocket.server.WsContextListener'
2016-01-16 03:23:20.734 DEBUG 19507 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Sending application start events
2016-01-16 03:23:20.756 DEBUG 19507 --- [ost-startStop-1] org.apache.tomcat.util.modeler.Registry  : Managed= Tomcat:type=Manager,host=localhost,context=/
2016-01-16 03:23:20.756 DEBUG 19507 --- [ost-startStop-1] o.a.tomcat.util.modeler.BaseModelMBean   : preRegister org.apache.catalina.session.StandardManager[] Tomcat:type=Manager,host=localhost,context=/

Thank you in advance.

tim_yates
  • 167,322
  • 27
  • 342
  • 338
oct
  • 1
  • 1
  • 3
    Have you tried `-Djava.security.egd=file:/dev/./urandom` ? – Roman Jan 16 '16 at 08:42
  • My thoughts exactly. I've been hit by this problem on a DigitalOcean machine as well. https://wiki.apache.org/tomcat/HowTo/FasterStartUp#Entropy_Source – JB Nizet Jan 16 '16 at 08:43
  • OMG, thank you guys... I think I tried this too, but most likely in a wrong way and did not pay attention too much. – oct Jan 16 '16 at 14:30

0 Answers0