Home > Java > Tomcat 7 hangs during startup with CentOS 7

Tomcat 7 hangs during startup with CentOS 7

I recently installed Tomcat 7 for CentOS 7 and had a weird problem. The server would hang at startup. No errors, but no progress either. Strange, Tomcat has always been very stable and simple to use in my experience. It turned out to be an issue with SecureRandom. If the entropy source used for initialization is low on entropy it can take a very long time to set things up. See this post for details.

The solution was simple, just add a system property to /etc/tomcat/tomcat.conf:


JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"

Problem solved, SecureRandom uses the specified file as entropy source and it works.

Advertisements
Categories: Java
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: