java.net.ConnectException: Connection refused - Server keeps waiting for agent to connect

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

java.net.ConnectException: Connection refused - Server keeps waiting for agent to connect

preet_t
Hello. I am getting the following error:

java.net.ConnectException: Connection refused (Connection refused)
        at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
        at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
        at java.base/java.net.Socket.connect(Socket.java:608)
        at java.base/java.net.Socket.connect(Socket.java:557)
        at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182)
        at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
        at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
        at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
        at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:341)
        at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:362)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1248)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1015)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1515)
        at org.powertac.server.WeatherService$WeatherRequester.webRequest(WeatherService.java:344)
        at org.powertac.server.WeatherService$WeatherRequester.run(WeatherService.java:310)
        at java.base/java.lang.Thread.run(Thread.java:834)

I tried to run a simulation game using an old boot file and a weather data file.

The server that I am using is: https://github.com/powertac/server-distribution

The sample broker that I am using is: https://github.com/powertac/sample-broker

I am using the following Java version:
java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)

Maven version:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Reply | Threaded
Open this post in threaded view
|

Re: java.net.ConnectException: Connection refused - Server keeps waiting for agent to connect

grampajohn
Administrator
preet_t wrote
Hello. I am getting the following error:

java.net.ConnectException: Connection refused (Connection refused)
...
at org.powertac.server.WeatherService$WeatherRequester.webRequest(WeatherService.java:344)
at org.powertac.server.WeatherService$WeatherRequester.run(WeatherService.java:310)
at java.base/java.lang.Thread.run(Thread.java:834)

The server that I am using is: https://github.com/powertac/server-distribution

The sample broker that I am using is: https://github.com/powertac/sample-broker

I am using the following Java version:
java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)

Maven version:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
This happens when the weather server at Rotterdam fails to respond. It appears to be OK now.

But is this happening when you use a weather data file? That does not seem right. It should not even try to access the weather service in this case. I'll have to check whether there's a test case for this.

If it still fails, let us know and we will take a closer look.

John
Reply | Threaded
Open this post in threaded view
|

Re: java.net.ConnectException: Connection refused - Server keeps waiting for agent to connect

preet_t
Hello John. Thank you for your reply.

Yes, I am trying to run a simulation with a weather file. The game status is RUNNING for about 15 seconds and then it changes to FINISHED and at the same time the sample broker session (in the terminal window) also gets closed. During the time when game is running, the agent does not seem to be acting as there is no change observed in the graphs tab. In the session for server, it shows the connection refused exception.

I hope the server and sample broker repositories that I am using are compatible with my Java/Maven version.

Preet.
Reply | Threaded
Open this post in threaded view
|

Re: java.net.ConnectException: Connection refused - Server keeps waiting for agent to connect

grampajohn
Administrator
preet_t wrote
Hello John. Thank you for your reply.

Yes, I am trying to run a simulation with a weather file. The game status is RUNNING for about 15 seconds and then it changes to FINISHED and at the same time the sample broker session (in the terminal window) also gets closed. During the time when game is running, the agent does not seem to be acting as there is no change observed in the graphs tab. In the session for server, it shows the connection refused exception.

I hope the server and sample broker repositories that I am using are compatible with my Java/Maven version.

Preet.
Could you please send (or post somewhere and send a link) to the state and trace logs for the session? Or take a look at the last portion of the trace log and see if the problem is obvious?

Thanks!

John
Reply | Threaded
Open this post in threaded view
|

Re: java.net.ConnectException: Connection refused - Server keeps waiting for agent to connect

preet_t
Hello John.
The issue was beacuse I had not set some proxies. It seems to work fine now. Thanks a lot.

Best Regards,
Preet.