简体   繁体   中英

Tomcat 7 is not running on browser(http://localhost:8080/ )

Actually the apache-tomcat 7 server running at The Eclipse.but in browser getting error "The requested resource is not available." .Any reasons Please..?

When you start tomcat independently and type http://localhost:8080/ , tomcat show its default page (tomcat has its default page at TOMCAT_ROOT_DIRECTORY\\webapps\\ROOT\\index.jsp ).

When you start tomcat from eclipse, eclipse doesn't have any default page for url http://localhost:8080/ so it show error message. This doesn't mean that tomcat7 is not running.when you put your project specific url like http://localhost:8080/PROJECT_NAME_YOU_HAVE_CREATE_USING_ECLIPSE will display the default page of your web project.

I had the same issue and for me, I tried changing the options in

  • Server Locations

    and it worked.

    1. Double click on the Tomcat Server under the Servers tab in Eclipse
    2. Doing that opens a window in the editor with the top heading being Overview opens (there are 2 tabs-Overview and Modules).
    3. In that change the options under Server Locations, and give Ctrl+S (Save configurations) For me, Use Tomcat installation (takes control of Tomcat installation) worked
    4. Try starting the server and checking if localhost opens in the browser. Else select a different option.

I do not understand why that issue came up. I did search but did not find a relevant answer(Maybe I didn't use the right keywords). If someone knows why that worked , kindly share.

Thanks.

There could be a number of reasons, have it as a checklist and go through it

Is your server running on 8080?I mean that is the default port but it could be configured to run on other.

Also there is a possibility that the default application is removed/uninstalled that is why it is giving "the requested resource is not available"

Also it could be a proxy issue. make sure you are not using any proxy in your browser.

1)Goto Server tab 2)Right on server -> general -> click on switch location. 3)Double click on the server -> under server location -> select tomcat installation. 4) restart the server.

It will be proxy configuration of your browser. In NetWork Setting, use no proxy

For Manual proxy configuration add exception(No Proxy for in Firefox) like localhost:8080, localhost .

You may face two errors while testing tomcat server startup.

  1. Error in the Eclipse inbuilt browser - This page can't be displayed Turn on TLS 1.0, TLS 1.1, and TLS 1.2 in Advanced settings and try connecting to https://localhost:8080 again. If this error persists, it is possible that this site uses an unsupported protocol. Please contact the site administrator.
  2. 404 error in the normal browsers.

Fixes -

  1. For the eclipse browser error, check whether you are using secured URL - https://localhost:8080 . This should be http://localhost:8080
  2. For the 404 error: Go to Tomcat server in the console. Do a right click, select properties. In the properties window, Click "Switch location" and then click OK. Followed by that, Go to Tomcat server in the console, double click it, Under "server locations" select "Use Tomcat installation" radio button. Save it.

The reason for choosing this option is, When the default option is given as eclipse location, we will see 404 error as it changes Catalina parameters (sometimes). But if we change it to Tomcat location, it works fine.

有时另一个软件可以打开这扇门,这可能是导致此冲突的原因,请尝试更改 server.xml 上的门。

Double click on the Tomcat Server under the Servers tab in Eclipse Doing that opens a window in the editor with the top heading being Overview opens (there are 2 tabs-Overview and Modules). In that change the options under Server Locations, and g

You can run below commands.

 ./catalina.sh run

Note : Make sure the port 8080 is open. If not, kill the process that is using 8080 port using sudo kill -9 $(sudo lsof -t -i:8080)

Many of us get this error after setting up the eclipse and server for first time. This solution is -

  1. go to server tab

  2. select the properties option of your respective server and expand it

  3. in the properties window , select general tab -> click Switch Location -> click apply ->click ok .

This may work .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM