I have a web application (war file). When I deploy it through eclipse 3.5 using the WTP tools, I am able to start the tomcat server from within eclipse and view all the pages of the application. However I don't see my war file inside the webapps folder of tomcat home directory (or for that matter its exploded format). I was under the impression that tomcat reads all web applications under its webapps folder. How does tomcat read my application in this case? I am using tomcat 5.5.17 as my application server.
+1
A:
It's just all definied in the context.xml
which Eclipse has given to Tomcat. If you want to configure this behaviour, then doubleclick the Tomcat instance in the servers view and check the Server locations section. To achieve what you initially want/expected, you need to select Use Tomcat installation and if necessary also specify the Deploy path.
BalusC
2010-01-22 20:17:40
What do you mean by `context.xml which eclipse has given to tomcat`? Where is the context.xml located?
Harsha
2010-01-22 20:20:34
In my case the server locations section is disabled in eclipse.
Harsha
2010-01-22 20:21:53
It's specified in *Server path* field of the *Server locations* section. You need to browse furher something like `tmp0\conf\Catalina\localhost` and there you'll find the `context.xml` (which is *actually* named `contextPathAsYouHaveSpecified.xml`).
BalusC
2010-01-22 20:26:07
It is disabled when the server is already published with modules. **Read** the leading text of the section :)
BalusC
2010-01-22 20:26:44
ya I found it. But the context.xml contains only 1 line`<WatchedResource>WEB-INF/web.xml</WatchedResource>`What does that mean? I am curious to find out that how come tomcat loads it.
Harsha
2010-01-22 20:31:43
It's actually not the one you're asking for. The one you found is located in something like `tmp0\conf`, but you need to browse further something like `tmp0\conf\Catalina\localhost`. At any way, the `WatchedResource` setting is just to trigger the auto-deployer. Also see Tomcat docs: http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html
BalusC
2010-01-22 20:38:02
I dont have any other folder inside tmp0\conf\.
Harsha
2010-01-22 21:55:49
Then nothing has been published to Tomcat through Eclipse yet. Or you actually changed the *Server locations*.
BalusC
2010-01-22 21:58:19
I think application has been published.Because if I change any jsp file, I can see the changes on the UI. Same applies for class changes as well.
Harsha
2010-01-22 22:23:47
Oh, I already see, I configured my Tomcat to *Publish module contexts to separate XML files*. When it's disabled (as likely in your case) it's definied in `tmp0\conf\server.xml`.
BalusC
2010-01-22 22:29:42
And I have not changed my Server locations as well.
Harsha
2010-01-22 22:30:04
Ya I got it. Thanks a lot. You have been very patient and helpful. I will upvote your response as soon as I am able to, as currently SO says that my daily vote limit has reached.
Harsha
2010-01-22 22:48:04
You're welcome.
BalusC
2010-01-22 23:01:57