10

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.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Patan
  • 17,073
  • 36
  • 124
  • 198

3 Answers3

17

These are the steps I follow when I have to manually deploy a war in Tomcat on localhost:

  1. If Tomcat is running, stop/kill it.

  2. Go to the tomcat installation folder (this must be C:\Documents and Settings\tomcat6x for you), let's call it <tomcat>.

  3. In <tomcat>, delete the temp and work folders. They only contain temporary files.

  4. 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.

  5. Start your tomcat.

lanoxx
  • 12,249
  • 13
  • 87
  • 142
Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
  • Thank 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 – Patan Feb 20 '13 at 05:01
  • 1
    @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. – Luiggi Mendoza Feb 20 '13 at 05:03
  • I 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 – Patan Feb 20 '13 at 07:24
  • 1
    @User222 first stop/kill tomcat, then copy your **war** in the ``/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 ``/deploy folder and when tomcat starts it will unpack the war and place it in ``/webapps for you – Luiggi Mendoza Feb 20 '13 at 07:25
  • @User222 please go to ``/logs and erase all the files there. Kill your tomcat process, place your war in the ``/webapps folder and start it. After doing it please go to ``/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. – Luiggi Mendoza Feb 20 '13 at 07:38
  • Hey can anyone pl tell me how to start my deployed project from tomcat after copying myproj.war to webapps folder? –  Feb 26 '14 at 05:03
  • After tomcat server is up, war folders should be auto created. But in my case they are not created. What to do ? – PriyaS Aug 13 '20 at 15:08
  • @priyashukla Does this happen in a clean Tomcat installation? If it does, did you update any other configurations in your tomcat installation? – Luiggi Mendoza Aug 13 '20 at 16:57
5

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

Iswanto San
  • 18,263
  • 13
  • 58
  • 79
1

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.

rai.skumar
  • 10,309
  • 6
  • 39
  • 55