Tomcat, site can’t be reached - java

I am using Amazon EC2, on my VM installed Tomcat 8.5.8. Everything was ok, but recently i realized that my webapp not working. I didn't change anything, but everytime i try to open it - i get 'This site can’t be reached' error.
I have custom Security Groups rules for the HTTP traffic (port 80) and also HTTPS traffic (port 443), both on TCP. As i said, everything was ok, but now it's not working :(
here my logs: https://pastebin.com/hkDZ5HtM
my website address: http://antilamer.tk/

Problem was in Tomcat, i've reinstalled it and now it works.

Related

Ktor project localhost:8080 refuses to connect

I was working on a ktor project and everything was working fine. I started the server and it was working fine on port 8080 but now for some reason suddenly it stopped working. I killed the task and tried everything, I'm not sure what's wrong. I tried to reinstall IntelliJ Idea and I'm still facing the same issue. I tried using 127.0.0.1
, 0.0.0.0
, localhost but none of them work idk what to do. I've wasted like 2 hours on this thing. I've tried changing port, blocking firewall and antivirus.
change 127.0.0.1(localhost) to your private ip like 172.30.1.59 if you use wifi. if you use fixed ip then use it. i have same problem, but solve it with this. Nice!
cmd -> ipconfig -> use ip address
I usually had the same issue using Ktor and it is frustrating. Then I am gonna post the following possible fixes that you should try in order and reading the steps. I am going to consider that you are running a WebSocket server and a WebSocket client for your Android app in a unique computer.
You are running the server side and the client using the same ip and
it should not work, because the client can not connect to the
server. When I am testing a project that requires server-side and
client-side I use my computer to run the Android app and the laptop
to run the server side. If this is not your case, then, do
not pay attention.
In the client-side, when you create the instance of the HttpClient,
do you pass any value to the client as engine or you simply go
directly with lambda? From my experience, when I create the
HttpClient instance, only works these two following first ones:
val client = HttpClient {
install(WebSockets)
}
or
val client = HttpClient(CIO){
install(WebSockets)
}
The engine that doesn't work for me is:
val client = HttpClient(OkHttp) {
install(WebSockets)
}
Finally, when you create the WebSocket using the past client
instance, you should use
client.ws(
HttpMethod.Get,
"localhost",
8080,
"/"
)
{
//Client code
}
and not client.wss. That is because in local connection, your client
do not connect using TLS security and it will throw an exception. If
you're deploying your server-side in a hosting that has TLS security
as Heroku, then you can use the wss one, because the client-side
will connect using TLS certificate.
Hope that my response can help. Good luck!
I had the same problem and it turned out that it was because I had the HttpsRedirect and HSTS plugins installed. Due to this it refused to handle the http request and since I don't have any certificate for localhost or my local IP it didn't work.
Disabling these two plugins when running locally makes things work for me.

java webserver is not receiving requests from internet, Not Found error

I have restarted a project that i closed after it became too comfusing, the original project was a webserver run entirely from java code. I have started this back up in the hopes of making the code 100% my own using java. I have gotten to the testing stage of hosting website however whenever i try to connect from the outside world i am shutdown with an error page. I have note coded this error page and after extensive research it is viewable that the error page is originating from apache. The only problem with this is that there is no apache in the code or in the virtualbox server. I have also tested this on two different virtual servers: opensuse 13.1 and fedora 20.
The URL of the server is blends.hopto.org/beta. There should be a black background there with some arrows and a blue dot, but instead there is an error that states:
"Not Found
The requested URL /beta was not found on this server.
Additionally, a 404 Not Found error was encounted while trying to use an ErrorDocument to handle the request."
I do not get this error if i request the page from inside my local network. But i do from outside, it is not a port forwarding problem because my minecraft server works and the server is assigned to the public ip of my home router!
Thanks, any help is appreciated!
Extra info:
After positing this question i stumbled across some other problems and it seems that the error is originating from SELinux, however i have disabled SELinux and the error is still coming through!
This is not an answer. I cannot comment on StackOverflow yet but would like to help.
You said that you get an Apache error page, which means that Apache must be running on your system. You can check this by typing this in the terminal:
apachectl status
You don’t mention what port you want to serve on. Apache usually uses port 80. You could configure your homemade Java server to work on a different port, say 8080. Also, if you are using Fedora 20, then you will have to configure FirewallD to allow this.
Okay well i finally found out what the problem was after just looking over the assigned ips to devices and found it strange that our networked hard drive was assigned the very first ip always. So i logged into the hard drive and found out it had been capturing all the port 80 requests from the router in an attempt to do remote login!!! I am very excited that this problem is resolved! I will be hoping to release my WebServer API for everyone to use as it is incredibly small and gives the programmer full controll

javax.mail.MessagingException: Could not connect to SMTP host locally via netbeans

I know that there are many questions on this topic, and I have been searching for an answer for the past 4 months. Everyone says check host address, port, and firewall. Well I have done these items, but am still not having any success.
We are running our web application locally using Apache Tomcat 7.0.27 through Netbeans 7.2.1 and are no longer able to connect to the SMTP server to send emails. When running the application on a virtual machine located on the server, there is no issue connecting. We have no problem connecting and sending mail using telnet locally with the same parameters.
We have tried looking at the SMTP logs on the server, and were able to access some logs, but can't find any related to the refused connection. Which SMTP logs would provide more information on this issue? I tend to think that since the connection is refused it may not even trigger any logging, is this a correct assumption? We migrated to IIS7 several months ago and were having trouble accessing IIS 6.0 Manager, so I am not sure that they are even set up correctly.
Does anyone have any ideas of how to further troubleshoot the connection?
Thank you in advance, and please let me know if I can provide any further information.
Almost certainly this is a problem with a firewall or anti-virus program on your local machine. If you can connect from that machine using telnet but can't connect from that same machine using a Java application, there's something on that machine preventing Java applications from connecting.
I recently faced the same problem while running the Mail sending code and what I found is that the code which I had written recently is using the Java version Jre7. But the older codes run in Jre 6 environment, which works perfectly even now also.
So what I had done is I just change the Jre version of my recent code to Jre 6. After that the code works perfectly without any exception.
So try to change your runtime environment to lower Jre and run the code.

URL Rewrite IIS and Glassfish from port 8080 to 80

I'm running a glassfish server that handles all jsp and servlets.
Now there is a way to get it working so that you can run IIS on port 80 and glassfish on port 8080, now the problem is:
When i request http://localhost/myWebApplication it should rewrite the url and use http://localhost:8080/myWebApplication
Basically I make a request to IIS, but the response I get back must be from Glassfish.
When I request the url with port 8080 it works, because its getting it from Glassfish, but i need to go through IIS to Glassfish.
Here is a website that explains it all: http://jstoup.wordpress.com/2012/04/25/how-to-integrate-glassfish-with-iis/
but I still can't get it working.
I have got no idea how my url rewrite rules must be set up.
This is James from the blog you referenced. If you haven't gotten this working you may have to enable your server farm as a proxy. If you select your web farm there should be a proxy config in the center console. All you should have to do is turn that on and you should be good to go. Let me know if you've got any problems

Can't connect to tomcat webservice

So I've been doing a java webservice in Eclipse in which I have launched on a localhost tomcat from Eclipse. This has worked very good as long as I've been connecting to the tomcat started from Eclipse.
However now I want to try deploy it on my tomcat separated from Eclipse but still on localhost. So I exported my web project to a .war file and deployed it with the tomcat manager app. However now I cant reach it from my client any longer. I'm running the tomcat on port 8080, just as my Eclipse tomcat did. BUT I can go to a reasource URL from my web browser and receive proper information, so the service is running(which the manager app is saying as well).
The client is a android device connected to the same network. The service fetches information from a MySQL database on the same machine. This connection worked fine before exporting it to war on my other tomcat
What am I doing wrong here? Just ask if you need any further information!
Ok so after testing I found it strange that I got connection time-outs and not something else. It also took at least 10 seconds before any feedback occurred. Sooo it felt like a firewall problem which indeed it was.
First I needed to portforward the tomcat port in my router to the machine ip that was hosting it. Then I remembered I had Windows firewall on that very machine which was also blocking conenctions on that port. So I allowed connections on tomcat port and BAM! It worked.
Thanks for all your comments, of course I should have thought about opening my ports before coming here.

Categories