I have a Grails application, built to a war file (~30mb). When I attempt to deploy the war file on Tomcat 6 via the application manager, it takes upwards of 10 minutes to deploy
It's not always that you have sufficient access rights to manually put files in the webapps
folder -- you are supposed to use the Tomcat Application Manager for .war
file deployment, and need to make it work.
For me, it has been common that the process of uploading of a .war
file to the server cannot complete; it gets stuck somewhere in the middle and the file is only partially uploaded to the server, no matter how many times I retry. In such situations, I have found it worthwhile to try another browser. For instance, I've found myself stuck using Google Chrome but once I switched to a freshly started Firefox browser, things worked out.
As noted I would copy the war to the webapps folder and let tomcat do the deployment, its also quicker saving you time.
Both Tomcat and Jetty will support a hot deploy. They simply monitor the deploy directory for changes, so you can just copy the .war file into that directory, and the server will undeploy/redeploy.
If using a remote server check the lag is not the time take to upload the war to a remote server over the network.
Definitely check the Tomcat logs for any errors/warnings.
You probably have some expensive/sensitive code logic in one of the ServletContextListener
s. They are usually initialized during startup. If so, then I would debug/profile it for any performance matters/leaks.
Don't use application manager. My way is to upload it somewhere out of the webapps directory and then copy it to webapps directory. Takes a lot less of deplyoment time.
I upload the WAR to my home directory, cd to /usr/local/tomcat, then run the following commands:
bin/shutdown.sh
rm webapps/ROOT.war
rm -rf webapps/ROOT
cp ~/ROOT.war webapps
bin/startup.sh
This may be relate to this BUG of JDK
I readed this article, Tomcat7 starts too late on Ubuntu 14.04 x64 and resolved my problem.
Try to resolve it by replacing
securerandom.source=file:/dev/urandom
with
securerandom.source=file:/dev/./urandom
in $JAVA_PATH/jre/lib/security/java.security