How to start Tomcat through Eclipse plug-in

Source: Internet
Author: User
Tags blank page
How to start Tomcat through Eclipse plug-in

At present, a problem occurs when Tomcat is started through the Eclipse plug-in, that is, when http: // localhost: 8080/is accessed, HTTP status 404 The requested resource (/) is not available. error, but there is no problem accessing the project through http: // localhost: 8080/MyApp, the system configuration is correct, and the startup in % atat_home %/bin is manually run. BAT and shutdown. bat is okay. You can access http: // localhost: 8080/, http: // localhost: 8080/manager, http: // localhost: 8080/admin/index correctly. JSP.

Development Environment
Eclipse

Version: 3.4.2

Build ID: M20090211-1700

 

Tomcat 6.0.18

 

Tomcat plug-in

Wtp-sdk-R-3.0.4-20090213193639

Org. Eclipse. JST. server. tomcat. core_1.1.104.v20081006.jar

Org. Eclipse. JST. server. tomcat. ui_1.1.101.v20080620.jar

Solution
When you manually start Tomcat, % atat_home %/webapps (including docs, host-manager, manager, and root4 Directories) are used as the default webapp directory, the % tomcat_home %/webapps directory contains root, corresponding to the root directory of the server "/", that is, accessing the Tomcat welcome page through http: // localhost: 8080.

 

If Tomcat is started through the plug-in eclipse, % eclipse_workspace_home %/is used /. metadata /. plugins/org. eclipse. WST. server. core/tmp0/wtpwebapps are used as the webapp directory. wtpwebapps do not have a root webapp or sometimes contain an empty root webapp. In this case, access http: // localhost: 8080/and you will see HTTP
Error 404 or a blank page. If you copy the docs, host-manager, manager, and root directories under % atat_home %/webapps to the wtpwebapps directory, you can also use http: // localhost: 8080/access the Tomcat welcome page.

 

By default, the Tomcat plug-in eclipse sets % eclipse_workspace_home % /. metadata serves as the server location. Therefore, when Tomcat is started using the eclispe plug-in, the server only runs the project that has been released to tomcat in the eclipse workspace.

 

Double-click "Tomcat 6 at localhost" in the Server View to open a Tomcat server editor. "server locations" is the configuration server location. Note: If the publish project has been deployed on the server (the project will be released when the application is started), the server locations Column cannot be modified. You can remove the project and clean the server first, make the server locations column changeable. Select "use tomcat installation". When you start Tomcat using the eclispe plug-in, all applications in the % tomcat_home %/webapps directory will be started.

 

If you only want to run an eclipse workspace application project, you can select "use workspace metadata". If you want to run an application project other than the eclipse workspace at the same time, you can select "use tomcat installation ".

 

Tomcat6.0.18 configuration problems
When you manually start tomcat6.0.18, you cannot access http: // localhost: 8080/Host-manager, HTTP status 404 The requested resource (/) is not available. the error does not exist in tomcat5.0.25.

 

Cause: the default configurations of tomcat6.0.18 and tomcat5.0.25 are different. Tomcat6 is secure and the directory browsing function is disabled by default. Otherwise, if no default homepage exists in the access directory, the file list in the directory will be leaked.

Omcat-6.0.18/CONF/web. the xml configuration is as follows: <servlet> <servlet-Name> default </servlet-Name> <servlet-class> Org. apache. catalina. servlets. defaultServlet </servlet-class> <init-param> <param-Name> debug </param-Name> <param-value> 0 </param-value> </init- param> <init-param> <param-Name> listings </param-Name> <param-value> false </param-value> </init-param> <load- on-startup> 1 </load-on-startup> </servlet> the same configuration options are in Tomcat-5.0.2 5/CONF/web. the configuration in XML is as follows: <servlet> <servlet-Name> default </servlet-Name> <servlet-class> Org. apache. catalina. servlets. defaultServlet </servlet-class> <init-param> <param-Name> debug </param-Name> <param-value> 0 </param-value> </init- param> <init-param> <param-Name> listings </param-Name> <param-value> true </param-value> </init-param> <load- on-startup> 1 </load-on-startup> </servlet> the solution is to set tomcat-6.0.18/CONF/We Change "false" in B. XML to "true.

From: http://blog.csdn.net/xingfuzhijianxia/article/details/6543177

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.