views:

416

answers:

1

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
What do you mean by `context.xml which eclipse has given to tomcat`? Where is the context.xml located?
Harsha
In my case the server locations section is disabled in eclipse.
Harsha
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
It is disabled when the server is already published with modules. **Read** the leading text of the section :)
BalusC
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
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
I dont have any other folder inside tmp0\conf\.
Harsha
Then nothing has been published to Tomcat through Eclipse yet. Or you actually changed the *Server locations*.
BalusC
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
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
And I have not changed my Server locations as well.
Harsha
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
You're welcome.
BalusC