I am installing tomcat with mysql + eclipse to run a simple web page with search function. I followed the example from here: https://www.roseindia.net/jsp/searchbook.shtml
However, when I submitted the form, error was displayed.
I changed the tomcat port from 8080 to 8085 so when I browsed the local host 8085, it also displayed error. Moreover, when I run another jsp file, the port shown is 8080 not 8085 as I set default.
I tried several solution on google and stackoverflow also but it did not work. I did not know the reasons why. Quite strangelly, I did the same with the example https://www.roseindia.net/jsp/searchbook.shtml from my computer at home. It worked without error.
I had install tomcat10 on my Pi 3B+ Debian full desktop Linux 32bit OS
To make the tomcat10 server successfully instal on my freshly build machine I follow the following recommended settings.
pi#Home:~ $ java -version
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-post-Raspbian-1deb10u2)
OpenJDK Server VM (build 11.0.9.1+1-post-Raspbian-1deb10u2, mixed mode)
Then download and install tomcat10 from:
wget https://downloads.apache.org/tomcat/tomcat-10/v10.0.2/bin/apache-tomcat-10.0.2.tar.gz
Change the IP address to my local IP address in both following XML files:
Manager File: ./webapps/manager/META-INF/context.xml Host Manager
File: ./webapps/host-manager/META-INF/context.xml
<Context antiResourceLocking="false" privileged="true" >
<CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"
sameSiteCookies="strict" />
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1|192.168.0.16" />
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
After installation complete, I manage to set the environment and start the server
root#Home:/usr/local/tomcat10# ./bin/startup.sh
Output:
Using CATALINA_BASE: /usr/local/tomcat10
Using CATALINA_HOME: /usr/local/tomcat10
Using CATALINA_TMPDIR: /usr/local/tomcat10/temp>
Using JRE_HOME: /usr/lib/jvm/java-11-oracle
Using CLASSPATH: /usr/local/tomcat10/bin/bootstrap.jar:/usr/local/tomcat10/bin/tomcat->juli.jar
Using CATALINA_OPTS:
Tomcat started.
but when I type localhost:8080 I get an error message:
This site can’t be reached localhost refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
As some of the articles on the web suggest to change port 8080 to port 80 in server.xml even trying this option doesn't solve my problem because I have apache webserver running on port 80 by typing localhost:80 it loads the index page for apache webserver
As it is a fresh install and I do not have any firewall installed in my system even on my Router firewall I have enabled TCP/UDP ports 80 and 8080
can anyone please suggest what should I do to load the tomcat index page?
As I have posted this question couple of days ago but I was unable to get an answer so I decided to try a few methods of my own to see if I can resolve the problem. In my case solution, I am posting solved the above issue and I am able to connect to localhost:8080 from my browser window. I have to confess I found this solution by flook I still don't know the logic behind what made it work but it is working.
root#Home:/usr/local/tomcat10# ./bin/startup.sh
Output:
Using CATALINA_BASE: /usr/local/tomcat10 Using CATALINA_HOME:
/usr/local/tomcat10 Using CATALINA_TMPDIR: /usr/local/tomcat10/temp> Using
JRE_HOME: /usr/lib/jvm/java-11-oracle Using CLASSPATH:
/usr/local/tomcat10/bin/bootstrap.jar:/usr/local/tomcat10/bin/tomcat->juli.jar
Using CATALINA_OPTS:
Tomcat started.
at this stage, I know tomcat is installed successfully and services are all up and running therefore there maybe is something wrong with the browser which may be causing a connectivity issue.
So I took the following steps:
Step No:1
I have click on three dots on the top right-hand side of the Chrome browser window (setting) then I click on more tools then click on clear browsing data.
From the Clear browsing, data window clicked the advance tab and select all times from the drop-down list
Tick all options except Password and other sign-in data and Autofill option
After your selection click the Clear data button
Open new browser window and type localhost:8080
Got unable to connect to the server message
Step NO:2
Now open the My account setting page and from here browse to My activity and clear all previously recorded activities log and turn off all active activity recording sliding switches
Web & App Activity
Location History
YouTube History
Ad personalisation
Open the web browser and typed localhost:8080 (Enter)
still got the same error message
Step NO:3
Go to add the Ad settings, I turned the Ad personalisation setting OFF in past because I didn't want Google to collect my browsing data In your case it might still be ON so I turned it back on for my browser.
now type localhost:8080 surprisingly tomcat10 index page open in my browser window To test if it was Ad setting which was stoping tomcat10 index page to load in browser window I turned Ad personalisation tab OFF again and type localhost:8080 and press Enter
Even the Ad personalisation tab is OFF but this time tomcat10 index page is loaded to the browser window again.
Therefore I am not 100% sure if it was Ad personalisation state which was not allowing the tomcat10 index page to load in the browser window or one of the other previous options which I turned off
To test further I have close all my browsers and then type localhost:8080 in a new browser window and the index page still loading successfully.
This solution is working for me hope it will help other readers too
I get a 302 redirection error when trying to use appcfg.py to upload data to my local dev server. If I use a browser to access the relevant page (_ah/remote_api) I get a login page, the pre-filled in test#example.com works, but I get no prompt for that from the cmd line.
Im using the Java variant of GAE, and I've used the upload_data command of appcfg.py before, I think the difference here is that I'm using a newer version than I have before (new machine).
Any thoughts on how to fix this? I have checked around the net, and I cant find anyone else with the issue of being redirected to a login page. The command I am using is:
./gae/appcfg.py upload_data --url=http://127.0.0.1:8080/_ah/remote_api --filename=file
Thanks
sigh
replacing 127.0.0.1 with localhost works as per the December 19 message here: https://code.google.com/p/googleappengine/issues/detail?id=2440
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.
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 give Ctrl+S (Save configurations)
For me, Use Tomcat installation (takes control of Tomcat installation) worked
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.
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.
404 error in the normal browsers.
Fixes -
For the eclipse browser error, check whether you are using secured URL - https://localhost:8080. This should be http://localhost:8080
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.
Sometimes another software can be holding this door and it can be the cause of this conflict, try change the door on the 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 -
go to server tab
select the properties option of your respective server and expand it
in the properties window ,
select general tab -> click Switch Location -> click apply
->click ok.
This may work .
http://localhost:8081/
HTTP Status 404 - /
type Status report
message /
description The requested resource (/) is not available.
Apache Tomcat/6.0.32
in eclipse to start the server then server is started but i open the tomacat home page then show above error
please help.. me....
Given you're getting a 404 I'd hazard a guess you are indeed running on port 8081. So the message is what it says: the resource is not available. Tomcat applications often run with a "context" to separate them from other apps running in the same container. The context is just a path like /myapp or something. This should be configured in your web.xml.
So having checked the context is "/" do you actually have a file/resource bound to the root like an index page?
And last suggestion is: what's been printed out to the eclipse console? Any Exceptions? If the webapp did not start properly you will get a "resource not found"