Tomcat 6.0 and Eclipse. Multiple instances of the

2020-07-16 08:32发布

问题:

I have Tomcat 6.0 installation on my Win7 PC. I used 64/32bit windows installation. In Eclipse I was able to set paths and set server to use my Tomcat installation. Everything seems working fine until I run server from inside Eclipse.

I noticed that http://localhost:8080/index.html page is not available (Tomcat default home page). I also can't access http://localhost:8080/axis2. I have Axis2 installed too.

Since I am struggling to make simple axix2 web service for long time, I am thinking maybe this Eclipse instance of Tomcat is adding to my issues?

When I start Tomcat from windows GUI everything works as I expect.

Any ideas?

Thanks.

回答1:

Eclipse does by default not take control over the Tomcat installation and all of its pre-deployed webapps, instead it just uses its sole server engine and uses the workspace metadata as deploy space. When you start such a server configuration from inside Eclipse, all of the pre-deployed webapps will just be plain ignored, including Tomcat's default homepage.

To let Eclipse take control over the Tomcat installation, you need to doubleclick the Tomcat server entry in Servers view to get its configuration, then at the left column, under Server Locations, you need to select Use Tomcat installation (note, when it is grayed out, read the section leading text! It needs to be published without any projects).



回答2:

Yes, this is normal. In the Package Explorer, you can click the Servers folder and view the configuration files that the Eclipse instance is using, specifically server.xml and context.xml. You can edit this configuration to match your specific requirements.

You may also want to check out the section titled Tomcat Publishing Options in this link here: http://www.eclipse.org/webtools/releases/2.0/newandnoteworthy/server.php

I favor this approach because when WTP inevitably corrupts my configuration once every two weeks, I don't have to reinstall Tomcat, I can just delete the server and reconfigure it.