- This topic has 7 replies, 2 voices, and was last updated 20 years, 8 months ago by Riyad Kalla.
-
AuthorPosts
-
qingster_xieMemberI’m using MyEclipse v2.7-RC2, Windows 2000, Tomcat 4 on my local machine for development. Later, I want to deploy my project on a remote Tomcat server. I think the only way to do this is creating a .war file and upload it. Is it true? If it’s true, what’s the best way to make .war file?
Another question is that I notice server.xml was not modified when I deploy my project locally, only the files were copied to tomcat/webapps dir. I wonder how Tomcat know about the new application while the <context> tag wasn’t added to it’s server.xml?
Thanks,
Qing
Riyad KallaMemberQing,
The easiest way to make a WAR file is to setup a new “packaged deployment” in MyEclipse, this will actually make a WAR file for you. Secondly, when an application is deployed in a WAR format, you container (Tomcat) needs to be setup to deploy these packaged applications, so you can just drop them in the /webapps folder. If this is set to TRUE, Tomcat will create a new context automatically for the life of the application server. If you restart the server, the context is destroyed and only recreated if Tomcat sees the webapp under the /webapps folder. You can make this context permanent (for example if you NEED to, to setup a JNDI data source or something) by launching the Tomcat Adminstrator while the server is running, and hitting the “Commit Changes” button, this will write out a new server.xml file for you that will be persistent between reloads of the app server.
qingster_xieMemberHow to setup a new “packaged deployment” ? 🙂
Qing
Riyad KallaMemberWhen you are in the MyEclipse perspective, on the toolbar you should have 4 buttons (New, Save, Save As, Print) then a set of 2 buttons (App server control, deployments). You want to click the deployments button. Then from the dropdown, select the project you are creating the deployment for, and select “packaged”.
Note, that you need to have the app server you are trying to deploy to setup ahead of time, so the tool knows where to put the WAR file.
You can then go retrieve the WAR file from the deployment directory (it should tell you in the textfield where it is putting it).
qingster_xieMemberIt works very well, just I have to stop and then start Tomcat each time I deploy the war file, so Tomcat will expand it. I wonder if there is a way to avoid this?
Riyad KallaMemberQing,
This is actually a Tomcat setting. If you run Tomcat, and login to the administrator, expand the “Service” node, then click on the “Host” node. In the right panel you want to set “Live Deploy” and “Unpack WARs” to true.
qingster_xieMemberRiyad,
Thank you very much for your quick and helpful support. I will read more documents about tomcat.
Qing
Riyad KallaMemberNo problem, I hope it helped!
-
AuthorPosts