NASAWorldWind / WorldWindJava

The NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.
724 stars 327 forks source link

"java.net.SocketTimeoutException: Connect timed out" running the demo app #219

Open daniel-lima opened 3 years ago

daniel-lima commented 3 years ago

Description

When running the demo application, I get a lot of

GRAVE: Retrieval failed for https://worldwind26.arc.nasa.gov/elev?EXCEPTIONS=application/vnd.ogc.se_xml&REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.3.0
dez 08, 2020 6:46:28 AM gov.nasa.worldwind.util.SessionCacheUtils retrieveSessionData
GRAVE: Exception while retrieving resources for https://worldwind26.arc.nasa.gov/elev?EXCEPTIONS=application/vnd.ogc.se_xml&REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.3.0
java.net.SocketTimeoutException: Connect timed out
    at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546)
    at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
    at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:339)
    at java.base/java.net.Socket.connect(Socket.java:603)

If I replace worldwind[0-9][0-9].arc.nasa.gov with data.worldwind.arc.nasa.gov in all config files, it seems to work... What am I missing here?

Steps to Reproduce

  1. Download https://github.com/NASAWorldWind/WorldWindJava/releases/tag/v2.2.0
  2. Make ./run-demo.bash executable
  3. Run /run-demo.bash
  4. Try to zoom in or interact with the 3D virtual globe in any way
  5. Check the console output

Expected behavior: No errors on the console and the layers actually working

Actual behavior: A bunch of "Connect timed out" to any URL with a hostname similar to worldwind[0-9][0-9].arc.nasa.gov and the layers don't seem to work

Reproduces how often: 100%

Operating System and Version

[What operating system and version are you using?]

Additional Information

As I write before, when I replace worldwind[0-9][0-9].arc.nasa.gov with data.worldwind.arc.nasa.gov in all config files, it seems to work.

As a side note, prior to open this issue, I tried to contact this email address, but all my messages failed. arc-worldwind@mail and mailman@lists don't seem to work as well.

m11a-code commented 3 years ago

I have a similar issue occurring with our software even when using previous releases of WWJ (v2.1.0).

The ones that I notice in the logs that timeout are worldwind25 and worldwind26. I haven't tried replacing those URLs with data.worldwind.arc.nasa.gov like @daniel-lima mentioned, but I would love to hear if this is an issue that is going to be addressed in a future release or not.

markpet49 commented 3 years ago

Hi, Thanks for your interest in WorldWind. As a free service, the WorldWind servers see a lot of traffic and abuse. We have commissioned upgrades to the servers that will be deployed soon. The WorldWind Java platform uses very conservative values for its retrieval and task queues. WorldWind Java performs much more predictably with upgraded settings: Property name="gov.nasa.worldwind.avkey.RetrievalPoolSize" value="32" Property name="gov.nasa.worldwind.avkey.RetrievalQueueSize" value="400" Property name="gov.nasa.worldwind.avkey.RetrievalStaleRequestLimit" value="60000" Property name="gov.nasa.worldwind.avkey.TaskPoolSize" value="32" Property name="gov.nasa.worldwind.avkey.TaskQueueSize" value="60" in the worldwind.xml configuration file.

Regards,

Mark

markpet49 commented 3 years ago

FYI: The current support e-mail address for the WorldWind team is: arc-worldwind@mail.nasa.gov.

markpet49 commented 3 years ago

The above e-mail address is monitored several times a week.

markfilan commented 2 years ago

Your Java socket shows SocketTimeoutException means that it takes too long to get respond from other device and your request expires before getting response. This exception is occurring on following condition.

Solution: A java developer can pre-set the timeout option for both client and server operations.

From Client side:

Socket socket = new Socket();
SocketAddress socketAddress = new InetSocketAddress(host, port);
socket.connect(socketAddress, 12000); //12000 are milli seconds

From Server side:

ServerSocket serverSocket = new new ServerSocket(port);
serverSocket.setSoTimeout(12000);