Background

When some of their Engineers ran their automation and the test results were written to SpiraTeam, they were receiving a 502 Connection reset by peer error message on the SOAP web service calls. They added code to catch the exception and try again, which helped a bit, but sometimes it would fail again. These were causing the automation to fail on submitting test results to SpiraTeam and causing the Engineer to have to manually re-execute the automation.

Initially it was thought that the SOAP web service calls were only responding with the 502 error, but then some of the REST API calls that are part of the latest jUnit plugin also failed, so it looked like the issue was affecting both SOAP and REST web service API calls equally

One of the more detailed errors was:

Error sending results to SpiraTest server (Failed to access the WSDL at: https://xxxxxxx.spiraservice.net/Services/v3_0/ImportExport.svc?WSDL. It failed with: 
                Server returned HTTP response code: 403 for URL: https://xxxxxxx.spiraservice.net/Services/v3_0/ImportExport.svc?WSDL.)
javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://xxxxxxx.spiraservice.net/Services/v3_0/ImportExport.svc?WSDL. It failed with: 
                Server returned HTTP response code: 403 for URL: https://xxxxxxx.spiraservice.net/Services/v3_0/ImportExport.svc?WSDL.

Solution

The client was able to solve it by some deduction and elimination with our assistance:

We were able to finally resolve this issue by upgrading the Java SDK on our client laptops to 1.8.0_161 from 1.8.0_121.  The lowest version of Java SDK we found that works is 1.8.0_152.  We were seeing socket exceptions and 403 errors before the upgrade.

It appears that Sun made changes to their SDK code at some point on how they handle sockets.

So we recommend updating the JVM to 1.8.0_152 if you are using Java 8.