How to deploy war files to tomcat manually?
Solution 1
These are the steps I follow when I have to manually deploy a war in Tomcat on localhost:
If Tomcat is running, stop/kill it.
Go to the tomcat installation folder (this must be C:\Documents and Settings\tomcat6x for you), let's call it
<tomcat>
.In
<tomcat>
, delete the temp and work folders. They only contain temporary files.If it's a jar file maybe is for configuration, so drop it in
<tomcat>
/lib folder. If it's a war file, drop it in<tomcat>
/deploy or in<tomcat>
/webapps folder.Start your tomcat.
Solution 2
Put it in /WEB-INF/lib folder of the deployed webapp should work. For example : if you have webapp named myapp, then put your jar in webapps/myapp/WEB-INF/lib
Solution 3
Deploy web application : copy your war file to webapps directory inside tomcat.
(Make sure that your war file gets unpacked to create corresponding directory; If your tomcat is running then you don't need to do anything else. Tomcat will take care of it automatically.)
Deploying jar file can be done similar way by putting jar inside lib directory of your deployed application; but to reflect changes you might have to restart tomcat.
Patan
Updated on May 26, 2020Comments
-
Patan almost 4 years
I have a war at location
"C:\Documents and Settings\myProj.war".
The web project is also available at
"C:\Documents and Settings\myProj".
I want to deploy this to one tomcat.
location of the tomcat is
"C:\Documents and Settings\tomcat6x".
Please tell me how to do this manually or through command prompt.
One application is already running in Tomcat. It is a maven project. I want to deploy another application on same tomcat which is not maven application.
-
Patan about 11 yearsThank you for the answer. my file is abcd.war. So I will copy and paste the war at "....\tomcat6x\webapps". Will it be sufficient. And I will restart the tomcat
-
Luiggi Mendoza about 11 years@User222 yes, that would be enough. If you want to deploy an application without restarting the whole server, use GlassFish or JBoss Web Application Servers.
-
Patan about 11 yearsI had followed your tips. I pasted it in webapps folder after restarting the tomcat, I cannot see the war there. Its not getting reflected. when I browse that application, I am getting page not found error. Can you help what could have gone wrong
-
Luiggi Mendoza about 11 years@User222 first stop/kill tomcat, then copy your war in the
<tomcat>
/webapps folder, then start tomcat. If you have a jar, the webapps folder is not the right place to drop it. If that doesn't work for you, then drop the war in<tomcat>
/deploy folder and when tomcat starts it will unpack the war and place it in<tomcat>
/webapps for you -
Luiggi Mendoza about 11 years@User222 please go to
<tomcat>
/logs and erase all the files there. Kill your tomcat process, place your war in the<tomcat>
/webapps folder and start it. After doing it please go to<tomcat>
/logs and copy the contents of the catalina.out (unix/linux env, for Windows OS check catalina.log) file in your question in order to analyze the deployment problem. -
Admin about 10 yearsHey can anyone pl tell me how to start my deployed project from tomcat after copying myproj.war to webapps folder?
-
PriyaS over 3 yearsAfter tomcat server is up, war folders should be auto created. But in my case they are not created. What to do ?
-
Luiggi Mendoza over 3 years@priyashukla Does this happen in a clean Tomcat installation? If it does, did you update any other configurations in your tomcat installation?