B4J Question Unable to access server on localhost

ozok

Member
Licensed User
Longtime User
Hi,

I am trying to create a small test server using jserver. But I can't get it to work. I tried to derive my server from the sample provided here but using the original code also does not work.

I can launch the server using the IDE. In log it says server has started and I can see the java.exe under process explorer. Process explorer also reports that java.exe is listening to the configured port. However when I try to connect to localhost:8888 (this is the port for sample), under Opera, error message is "localhost sent no data" or something similar.

Turning off the antivirus did not work. I tried running B4J and command prompt as administrator.

Also, I can create a test server with Delphi using Indy, using the same port and it works fine. I can even access it from my mobile.

Regards.
 

ozok

Member
Licensed User
Longtime User
Sure, here is the log in the IDE

B4X:
2016-08-15 09:16:49.248:INFO::main: Logging initialized @162ms
2016-08-15 09:16:49.373:INFO:oejs.Server:main: jetty-9.3.z-SNAPSHOT
2016-08-15 09:16:49.444:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@675690{/,file:///E:/Download/ServerHelloWorld/ServerHelloWorld/Objects/www/,AVAILABLE}
2016-08-15 09:16:49.447:INFO:oejs.AbstractNCSARequestLog:main: Opened E:\Download\ServerHelloWorld\ServerHelloWorld\Objects\logs\b4j-2016_08_15.request.log
2016-08-15 09:16:49.545:INFO:oejs.ServerConnector:main: Started ServerConnector@ea639{HTTP/1.1,[http/1.1]}{0.0.0.0:8888}
2016-08-15 09:16:49.545:INFO:oejs.Server:main: Started @461ms
Server started

I'm on work computer now but the problem is still there.
 
Upvote 0

ozok

Member
Licensed User
Longtime User
Yes, I use http. See attachment for I what I get when I open http://127.0.0.1:8888 on local pc. However, running the jar in one of our production servers seem to work, at least I can access is using http://127.0.0.1:8888/hello. I can't access it remotely but I guess this is because ports are not configured.

Production server is running Win server 2008r2 (java version8 update 91), while local computers I tried run Win10 (java version8 update 91). Local server I tested runs Win server 2012 r2 (java version version 8 update 101).

Edit1: log for the one that works:
B4X:
2016-08-15 09:38:32.472:INFO::main: Logging initialized @359ms
2016-08-15 09:38:32.738:INFO:oejs.Server:main: jetty-9.3.z-SNAPSHOT
2016-08-15 09:38:32.862:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@9c9116{/,file:///C:/Users/Administrator/www,AVAILABLE}
2016-08-15 09:38:32.862:INFO:oejs.AbstractNCSARequestLog:main: Opened C:\Users\Administrator\logs\b4j-2016_08_15.request.log
2016-08-15 09:38:33.050:INFO:oejs.ServerConnector:main: Started ServerConnector@1d5622a{HTTP/1.1,[http/1.1]}{0.0.0.0:8888}
2016-08-15 09:38:33.050:INFO:oejs.Server:main: Started @970ms
Server started
The difference I notices is that all time values are double of the ones that do not work.

Edit2: Translation for attachment:
Cannot access this site.
12.0.0.1 refused to connect.
 

Attachments

  • b4j_server.jpg
    b4j_server.jpg
    39 KB · Views: 309
Upvote 0

billzhan

Active Member
Licensed User
Longtime User
You can ping you localhost in the command line.

B4X:
ping localhost
ping 127.0.0.1

And test with other browsers. Check if any proxy is used.
 
Upvote 0

ozok

Member
Licensed User
Longtime User
No proxy is used also I have given permission to java.exe in the firewall. Same result with several PCs.

Edit: I can't ping it either.
 
Upvote 0
Top