8

I am currently using tomcat 6 as my Web Server.
I have a very small application which should not take long to deploy on server, but my tomcat is taking too long start.

It is taking most of its time in following step.

INFO: Starting Servlet Engine: Apache Tomcat/6.0.16

I don't know why it is taking much time. Same is the case with stopping the server. I tried almost everything I know. I also tried to delete server from the workspace and started from scratch. I don't know what is the problem.

yole
  • 92,896
  • 20
  • 260
  • 197
NIVESH SENGAR
  • 1,285
  • 5
  • 19
  • 43

5 Answers5

4

You can find out which library consumes the time. When the server is being started in a debug mode, pause its thread several times and examine stacktraces. There may be possibly some library that populates its Spring application context, weaves advised objects, initializes file storage, whatever. If so, you will see it from stacktraces.

Alexey Berezkin
  • 1,513
  • 1
  • 10
  • 18
2

Have you removed all the default web applications that comes with the tomcat installation ? Even though your webapp is a small one, there might be other applications that are taking time to be installed. You can check this from the server log files with the name catalina___.log files.

NiranjanBhat
  • 1,812
  • 13
  • 17
2

I know this post is old, even i wanted to share few check points on this because these are irrespective of tomcat version...

I was facing the same issue and i followed below steps and now my server is starting with in 130 ms.

  1. First verify the console if you are using any IDE, there you can find time in milliseconds for each application. So you will come to know which one is taking long time.
  2. To make sure, your finding is correct just remove that app from 'webapps' folder and start tomcat again.
  3. Remove the default applications which you don't need. Usually we only use tomcat manager, so just keep manager app and remove other applications from 'webapps' folder
  4. Make sure 'temp' folder is empty
  5. Clean up the older log files. And don't write your application log files in server folder.
  6. Start the server first and deploy the file later. So that you don't face timeout error.

This is what i tried any succeed.

0190198
  • 1,667
  • 16
  • 23
1

Possibly this is due to a lack of availability of random entropy, which Tomcat requires.

See https://cwiki.apache.org/confluence/display/TOMCAT/HowTo+FasterStartUp#HowToFasterStartUp-EntropySource and Slow startup on Tomcat 7.0.57 because of SecureRandom

(Edit: first link updated)

David Plumpton
  • 1,929
  • 23
  • 31
0

I guess you have placed all your libraries (JARs) in the WEB-INF/lib folder. Instead move those to a separate directory and refer the directory or JARs using shared.loader in the catalina.properties