0

We are currently deploying our in house program on two different servers. Both of these servers built within Cisco Openstack. OS Centos 7.

The issue is, that with every redeploy of the app, we need to restart tomcat; shutting down tomcat is behaving as expected. When we start tomcat, the server is unresponsive for 10+ minutes.

Here is my process:

  1. shutdown tomcat using $TomcatHome/bin/shutdown.sh
  2. Deploy the two war files
  3. Start tomcat using $TomcatHome/bin/startup.sh

If I navigate to the URL associated with the webpage, the loading bar spins for about 10 or more minutes until the page suddenly comes up.

I also tried using a wget on the app's home page. I get an waiting for response error as seen below:

[vagrant@host-10-105-5-51 Gen]$ !w wget 10.105.5.47:8080/am --2016-09-10 11:34:51-- http://10.105.5.47:8080/am Connecting to 10.105.5.47:8080... connected. HTTP request sent, awaiting response...

I am not really sure how to approach this problem besides googling it.

I should add a few more details to this issue:

  • I run the app/tomcat on my local vm and it starts a few seconds after the startup script has been called.
  • Looking at the catalina out file in the logs Dir. There appears to be an error involving the phrase "Address is already in use"
  • The long startup time is almost certainly the initialization of your application, not tomcat itself. What do the logs say it's doing? – jordanm Sep 10 '16 at 19:05
  • @jordnm I would agree with you; however., when running the app/tomcat on a local machine or a different non-openstack machine, Tomcat and the webapp start within a few seconds from running the tomcat start up script. – Josafoot Sep 12 '16 at 16:48
1

I have found that the issue had something to SecureRandom. Here was my openstack machine:

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Running renew job for nxueo client in background 27-Sep-2016 09:25:08.992 INFO [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [632,566] milliseconds.

Here is my error on a vagrant machine:

26-Sep-2016 12:31:49.714 INFO [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [26,213] milliseconds.

This was remedied by executing the following command:

sudo echo "securerandom.source=file:/dev/urandom" >> $JAVA_HOME"/jre/lib/security/java.security";

0

It's difficult to say what's going on without further information, but since your webapp works fine eventually, I guess the deployment simply takes a very long time.

Have you checked the tomcat log for clues?

One common problem I have seen is if webapps require internet access or resolve a hostname during deployment and spend a long time waiting for a timeout.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.