-1

I am trying to run embadded jetty using eclipse. below is the code snippet.

Server server = new Server(4269);
ContextHandler context = new ContextHandler();
context.setContextPath("/abc");
server.start();
server.join();

I can see following in console when I run.

2015-09-12 10:52:41.360:INFO:oejs.Server:jetty-8.1.8.v20121106
2015-09-12 10:52:41.402:INFO:oejs.AbstractConnector:Started    SelectChannelConnector@0.0.0.0:4269         

so its listening to 0.0.0.0:4269. I expect it to be accessible using localhost:4269/abc, 127.0.0.1:4269/abc and 192.168.1.134:4269/abc. However, it doesn't work with 192.168.1.134:4269/abc and even with my static ip http://10.xxx.xx.xx:4269/abc.

Please guide me what am I doing wrong?

Kartik Patel
  • 479
  • 1
  • 4
  • 19

1 Answers1

0

First, Jetty 8 is EOL (End of Life) now, you are strongly encouraged to upgrade.

The output you see ...

SelectChannelConnector@0.0.0.0:4269

Says that the Java bound to the non-routable meta-address 0.0.0.0 for all local IPs, which means it bound to all of your available network interfaces.

Things to look for:

  • Does that interface exist?
  • Is that interface up and connected with a valid IP?
  • Can Java see that interface?
  • Does your netstat command (or equivalent on your OS) report that something is bound to interface `192.168.1.134'?
  • Are Firewall rules preventing access?
  • Is there network security rules that might be preventing access? (SELinux)
Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
  • Thanks for your suggestion. The issue was with interface ip address which got changed due to it was mentioned as dhcp. I added manual ip address and it started working – Kartik Patel Sep 14 '15 at 10:58