1

I have configured jetty-maven-plugin in my eclipse Mars and I can run the server using jetty start and stop goals. I can able to access the website using http://localhost:8080/myapp but not using local IP address(i.e., http://192.168.0.5:8080/myapp) from my own computer or other computers connected in the same network via LAN and Wi-Fi.

As mentioned as a solution in these posts,

how to make jetty server accessible from LAN?

Configuring Jetty to accept connections from all hosts

I configured the server host to 0.0.0.0 from localhost to listen on all hosts. With this setting I can see on server start log,

INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080

and it works only on http://localhost:8080 but it's not accessible from http://192.168.0.5:8080.

I also tried running that if the interface is accessible using the Networks Interface Listing as mentioned in this comment. and I got,

Display name: NETGEAR WNA1000M N150 Wireless USB Micro Adapter
Name: wlan4
InetAddress: /192.168.0.5

I also tried turning off my Windows Firewall/antivirus but din't help. My jetty version is <jetty.version>9.3.0.M1</jetty.version> and JDK 1.7. What could be the problem? Any help is appreciated.

Community
  • 1
  • 1
Lucky
  • 16,787
  • 19
  • 117
  • 151

2 Answers2

1

McAfee Endpoint Security was the culprit here. It was blocking the requests with IP addresses from my very own computer. Turned off the firewall inside the Antivirus and I was able to access the site with http://192.168.0.5:8080/mysite from the browser and other devices connected through the network.

Lucky
  • 16,787
  • 19
  • 117
  • 151
  • By specifying a `192.168` address, your requests were actually going out onto the network and then coming back in again as if from another computer. So the concept of "my very own computer" is a not accurate here. If you requested from `localhost` or `127.0.0.1` - the loopback address - then it would indeed be your own computer, as the request doesn't even get out onto the network. – Stewart Oct 05 '17 at 15:25
0

Sometimes some other program opens your port on external address before you do that with Jetty. It will receive all traffic instead. On Windows you will not know it if you reuse port (that is Jetty's default behavior). Check with netstat -ano what is the IP of the process that is indeed listening on 0.0.0.0:8080. Verify if it is your Jetty process only.

Then try connecting with telnet or netcat and see if you can open the connection and what is the response.

Michał Grzejszczak
  • 2,599
  • 1
  • 23
  • 28
  • Thanks but, If the port is already used by some other program then I don't think I would be able to start the server. I also changed the port incase. But that never helped. The problem is not in starting jetty but accessing it with my local IP. – Lucky Dec 14 '15 at 18:21