Solution to the failure of accessing the home page after Tomcat is started successfully.

Source: Internet
Author: User

Solution to the failure of accessing the home page after Tomcat is started successfully.

Solution to the failure of accessing the home page after Tomcat is started

If you search for "tomcat started successfully, the error 8080 is returned when you enter http: // localhost: 404 ". Check the log to locate the problem. Check whether the port conflict exists. We recommend that you go to the server. modify the port in xml format. It is recommended that you enter netstat-ano In the cmd command to check whether the tomcat port has been used or whether the environment variable configuration is incorrect.

These may be correct, but there is another situation that is easily overlooked: tomcat, webapps directory does not have the ROOT folder!

Experienced people may smile. However, for those who do not know how to start tomcat, input http: // localhost: 8080 to enter the $ tomcat/webapps/ROOT path by default, it is easy to ignore this issue.

If you do not need environment variables, open the startup. bat file under $ tomcat/bin to view the content. If you can see the following:

set "CURRENT_DIR=%cd%    if not "%CATALINA_HOME%" == "" goto gotHome   set "CATALINA_HOME=%CURRENT_DIR%" 

It indicates that tomcat will automatically configure the environment variables at startup, so you do not have to configure the environment variables on your own. (Tomcat 5 and above have been configured in startup. dat .)

So why must I configure java environment variables when using tomcat?

1) tomcat is only the server that carries the program. jdk is required for running the program.

2) startup. bat needs to call catalina. bat and the JAVA_HOME environment variable is used for running catalina. bat (you can view the file by yourself ).

As for the Internet, we recommend that you use netstat-ano to check the port, and then run the taskkill command to terminate the process to solve the problem that the port is used. Generally, it is completely unnecessary. You only need to shutdown. bat and then OK. Start tomcat in myeclipse and report "Unrecognized Windows Sockets error: 0: JVM_Bind" (both ports are used ). Because you may have started tomcat elsewhere.

Thank you for reading this article. I hope it will help you. Thank you for your support for this site!

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.