I'm trying to move some stuff to Tomcat, which is running on a Windows server as a service. So I have created a Tomcat project in Eclipse, but I don't see anywhere to make Eclipse produce a War file for me, which I could then deploy?
Asked
Active
Viewed 467 times
2 Answers
1
Position yoursef to {WORKSPACE}/{YOUR PROJECT}/web/{YOUR APP CONTEXT}/
.
Type this: jar -cvf {YOUR APP CONTEXT}.war *

ioreskovic
- 5,531
- 5
- 39
- 70
1
Right click on your project on eclipse, from the context menu choose Export and choose War file in the upcoming window.

Serkan Arıkuşu
- 5,549
- 5
- 33
- 50
-
thanks! the war file is created now, so this answers the main question, but any chance you know why the deployment itself does not work? when i deploy the war with tomcat manager app, then it creates the meta-inf and web-inf folders for my web-app, but meta-inf only contains an almost empty manifest.mf file and web-inf only contains the classes? localhost/project unresponsive and the app does not appear in the applications list of the manager.. – Cel Jul 14 '12 at 19:29
-
Glat that it worked. That is the expected behaviour for the manifest file and WEB-INF/lib should have class files in it as you told. Are you sure that the folder on your tomcat/web-apps is "project" and does it contain index.jsp file? – Serkan Arıkuşu Jul 14 '12 at 19:45
-
the webapps subfolder that got created is the project name indeed, but there is no index.jsp in there; i created this test project pretty much based on http://www.idimmu.net/2009/03/11/tomcat-helloworld-servlet-with-eclipse/ (i.e. dynamic web project with added servlet) – Cel Jul 14 '12 at 20:40
-
You may look at the url in this image http://www.idimmu.net/wp-content/uploads/2009/03/hw11.png It shows that the link to be called is http://localhost:8080/helloworld/HelloWorld . The first helloworld is your project name and the second HelloWorld is the name of your servlet class. If you followed that tutorial you should call http://localhost:8080/project/HelloWorld – Serkan Arıkuşu Jul 14 '12 at 20:44
-
it turned out to be too much information to append the next problem here, so i have created a new post for the subsequent issue with deployment http://stackoverflow.com/questions/11491398/running-and-deploying-servlet-with-eclipse-and-tomcat-7 – Cel Jul 15 '12 at 11:22