Ubuntu14 Tomcat7 Application deployment time

  • Posted July 18, 2014

I am noticing that deploying a new applicaiton on tomcat7 takes a while to deploy. In the logs i can see all is clear but i cannot connect to http://host:8080 . Browser just hangs…

[localhost-startStop-1] INFO o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 12833 ms

Any ideas why i cannot connect ? If i wait half an hour, perhaps i will be able to connect…



Entropy Source

Tomcat 7+ heavily relies on SecureRandom class to provide random values for its session ids and in other places. Depending on your JRE it can cause delays during startup if entropy source that is used to initialize SecureRandom is short of entropy. You will see warning in the logs when this happens, e.g.:

<DATE> org.apache.catalina.util.SessionIdGenerator createSecureRandom INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [5172] milliseconds. There is a way to configure JRE to use a non-blocking entropy source by setting the following system property:

Note the “/./” characters in the value. They are needed to work around known Oracle JRE bug #6202721.

Also note that replacing the blocking entropy source (/dev/random)

Ok, so after waiting for about 2 hours, i can connect with the application now …

If i restart tomcat7, it takes similar time to access the app.

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I ran into the same thing and it took forever to figure out.


The random number generator collects various bits of information from the operation of the system as an “entropy source” to provide more randomness. This process blocks the start of the Tomcat server.


Use a different source of random numbers.

In /etc/default/tomcat7, add the following line below the existing JAVA_OPTS variable.


Take a look at How do I make Tomcat startup faster?. Does that help?