1

I have cloned a Spark project from git which I surely know works and operates correctly. When I run the program, the Jetty server ignites and looks like listening with no problem. Here is the console for that:

[Thread-0] INFO org.eclipse.jetty.util.log - Logging initialized @402ms
[Thread-0] INFO spark.webserver.JettySparkServer - == Spark has ignited ...
[Thread-0] INFO spark.webserver.JettySparkServer - >> Listening on      0.0.0.0:4567
[Thread-0] INFO org.eclipse.jetty.server.Server - jetty-9.3.2.v20150730
[Thread-0] INFO org.eclipse.jetty.server.ServerConnector - Started ServerConnector@36a9b54a{HTTP/1.1,[http/1.1]}{0.0.0.0:4567}
[Thread-0] INFO org.eclipse.jetty.server.Server - Started @600ms 

But when I send a request from any browser on my computer, it returns always empty response. I have configuration for the database and all and tried the same configuration with the same data on another computer and it works right away. I have look for the TCP connection status with TCPview and I saw that connection directly goes into time_wait state. Since it does not occur on the other computer I have tested, I'm guessing that the problem does not come from the program or database, but something causes this especially on my computer. Any opinion is appreciated. Thanks.

Lewis Hai
  • 1,114
  • 10
  • 22
ACS
  • 11
  • 4

1 Answers1

1

Make sure you're accessing your webservice like this http://localhost:4567/yourRouteName, note that Spark runs on a not so common port (I wold say), that can be locked by firewall policies or other security software, but you can change the port number like doing it this port(8080); before setting any route.

If nothing works, we would need more information, could you please share the source code of any route you're unable to access ?

Laercio Metzner
  • 1,351
  • 11
  • 22
  • 2
    I have formatted my computer since I thought that the problem is caused by some firewall policy and I could not figure out what to change. The problem went away after the format. Guess I could solve it without formatting but I needed it for some other reasons too, so any solution was fine for me. Anyways, thank you very much for help and sparing time for my problem. – ACS Feb 03 '16 at 09:34