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.
Related
I have an angularJS application with springboot and it runs on 8090 port number with "index.htm" file. Like below ;
192.168.1.25:8090/index.htm
I just googled about the changing port and I did the change with 80 port number so I can open the web page with
192.168.1.25/index.htm
But, in google there are plenty of angular result and they tell me to change those settings with in angular.json file. I created a temporary angular project and did those with successfully. But, I could not figure out about the angularjs part. I checked the project and I could not find any file like angular.json. After that checking the springboot, I found this part of where I can open the web page with the above second URL address ;
192.168.1.25/index.htm
The code of Spring Boot part is below (There is where I can change the port number) :
Those ones did the trick by the way.
config.getMemberAttributeConfig().setStringAttribute(ServerService.MANAGEMENT_URL_PREFIX, ":80/index.htm");
config.getMemberAttributeConfig().setStringAttribute(ServerService.MANAGEMENT_URL_PREFIX, ":80");
After those steps, I can easily serve my angularjs app on 80 port and start to thinking about editing the /etc/hosts file on the server machine as :
192.168.1.25/index.htm xyz.com
I did reboot when I finished the editing part and I tried again to write xyz.com on firefox browser it does not go to my application.
I am still looking on the google and still could not find any solutions about this problem.
Any help will be really appreciated.
Format for hosts file is
#<ip> <hostname that resolve to the ip>
192.168.1.25 xyz.com
# or a list of names
192.168.1.25 xyz.com myapp.xyz.com
You do not put any port numbers or path parts in it. This will obviously only work if you edit the hosts file on all the computers
you are indending to access the site from and not necessarily on the host running the application itself.
That being said, you should probably read on supported Spring Boot properties because starting an application server on a specific port should be as easy as adding application.properties file in java resources with the following line:
server.port=80
I was implemented two different servlets in two different web projects in netbeans using tomcat server. When try to run html file for one servlet in one project it running, but when trying to run another servlet in second project the following message appear in browser. This site cannot be reashed in localhost 8080 and localhost refused to connect.
I try to solve it by following steps in cmd:
1-ipconfig /release
2-ipconfig /all
3-ipconfig /flushdns
4-ipconfig /renew
5-netsh int ip set dns
6-netsh winsock reset
and try close proxy and windows firwall but the problem is still.
You are trying to serve requests with 2 programs in the same port, which can't be done. What would you expect it would happen if you went to localhost:8080? Both of them would be serving requests in that port, so the OS doesn't allow it.
You can go to tomcat>conf folder in one of the projects, and edit the server.xml file.
There should be a line saying Connector port. Replace "8080" for other port, for example "8081" and start tomcat.
I am developing a Java program and I was recommended to install XAMPP. Still, I am not sure if it is secure or not to my home computer. Is it dangerous or should I keep it? Sorry, I do not know anything about XAMPP.
Also, I started running it because I am doing a tutorial, and I came across the following error: http://prntscr.com/drwra6
Can anyone help me? Please, do not use difficult concepts :)
Thank you very much.
Short Answer
Uninstall Sype
Long Answer
Open Skype.
Tools -> Options -> Advanced -> Connection.
Disable the "Use port 80 and 443 for alternatives for incoming connections"
Sign Out and Close all Skype windows. Try restarting your Apache.
VERY LONG ANSWER
As I am working in a corporate environment where developers faces firewall issues, none of the other answers resolved my issue.
As the port is not used by Skype, but by some other internal applications, I followed the below steps to resolve the issue:
Step 1 - From the XAMPP Control Panel, under Apache, click the Config button, and select the Apache (httpd.conf).
Inside the httpd.conf file, somehow I found a line that says:
Listen 80
And change the 80 into any number / port you want. In my scenario I’m using port 8080.
Listen 8080
Still from the httpd.conf file, I found another line that says:
ServerName localhost:80
And change 80 to 8080.
ServerName localhost:8080
Step 2 - From the XAMPP Control Panel, under Apache, click the Config button again, but this time select the Apache (httpd-ssl.conf). Inside the httpd-ssl.conf file, find line that says
Listen 443
And change the 443 into any number / port you want. I’ll using 4433 as the new port number.
Listen 4433
Still from the httpd-ssl.conf file, find another line that says
ServerName localhost:443
And change 443 to 4433.
ServerName localhost:4433
Remember to save the httpd.conf and httpd-ssl.conf files after performing some changes. Then restart the Apache service.
SOURCE XAMPP, Apache - Error: Apache shutdown unexpectedly
CONCLUSION
Google first
Started a Tomcat server. It is running and listening on port 8080 as seen in the image but the page http://localhost:8080 doesn't load. No Error page is seen. Just a blank screen. What could be the issue?
After I had installed Tomcat8, I checked and I was able to access the index page. Since then I have added a Java Servlet class file in WEB-INF/classes/com/example/web.
See the image for more details:
what link fails? but i believe that you fails in this, the tomcat index is 404 error the manager is in 8080/manager and the apps 8080/apps but 8080/ is 404 error
My eclipse used to work fine but now I am no longer the administrator of my computer(I no longer have administrator priveledges) and i see that my already installed and working eclipse is now showing errors in my jsp files of the application which it didn't used to show before..
also I am not able to connect to tomcat server which seperately can be started normally but not inside eclipse.....
Is this something to do with my not being administrator anymore of is it something else....
would highly appreciate the help.....
I have now been able to run my tomcat server without admin previledge but problem of many files showing error still persists.........
the below written jsp code is showing error in all the files....:
<%
pageContext.getRequest().setCharacterEncoding("UTF-8");
String label = pageContext.getRequest().getParameter("rswitb1");
if(label==null)label="";
else label = label.replaceAll("<", "<").replaceAll(">", ">");
%>
I am not able to get what the problem ....
if anyone could help...
The connection to the external tomcat should be using only TCP/IP port 8080, there is no reason why a non-admin user should not be able to do that.
It's possible that your tomcat password has changed (or hasn't been set up at all)
There is a troubleshooting section at the eclipse wiki (if you are using WTP, that is)
First,check out the tomcat server is on: "netstat -an" to
find that whether the port8080 is used(if you didn't assign another server port.).
check out whether the server is on(netstat -an).
Maybe 8080 is used by tomcat.
You'd better reinstall tomcat as non administrator.