cancel
Showing results for 
Search instead for 
Did you mean: 

Getting : ERROR: Exception in request: java.net.SocketException: Connect

SOLVED
Contributor

Getting : ERROR: Exception in request: java.net.SocketException: Connect

Hi All, Recent times I'm facing ERROR: Exception in request: java.net.SocketException: Connection reset  a lot. Everytime has to run 3 to 4 times to execute the API. I don't know what is the issue here? I tried couple of solution from internet but I couldn't fixed it. Any inputs to resolve this would be appreciated. Because it really kills the automation and has to run every API 3 to 4 times to get success. 

Tue May 05 16:51:23 UTC 2020: ERROR: Exception in request: java.net.SocketException: Connection reset
Tue May 05 16:51:23 UTC 2020: ERROR: An error occurred [Connection reset], see error log for details


HTTP-LOG
=========
[write] I/O error: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset


ERROR-LOG
=========
Tue May 05 16:51:23 UTC 2020: ERROR: java.net.SocketException: Connection reset
   java.net.SocketException: Connection reset
   	at java.net.SocketInputStream.read(Unknown Source)
   	at java.net.SocketInputStream.read(Unknown Source)
   	at sun.security.ssl.InputRecord.readFully(Unknown Source)
   	at sun.security.ssl.InputRecord.read(Unknown Source)
   	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
   	at sun.security.ssl.SSLSocketImpl.waitForClose(Unknown Source)
   	at sun.security.ssl.HandshakeOutStream.flush(Unknown Source)
   	at sun.security.ssl.Handshaker.kickstart(Unknown Source)
   	at sun.security.ssl.SSLSocketImpl.kickstartHandshake(Unknown Source)
   	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
   	at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
   	at sun.security.ssl.AppOutputStream.write(Unknown Source)
   	at com.eviware.soapui.impl.wsdl.support.http.SoapUILoggingOutputStream.write(SoapUILoggingOutputStream.java:41)
   	at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:126)
   	at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:138)
   	at org.apache.http.impl.io.SessionOutputBufferImpl.flush(SessionOutputBufferImpl.java:146)
   	at org.apache.http.impl.BHttpConnectionBase.doFlush(BHttpConnectionBase.java:177)
   	at org.apache.http.impl.DefaultBHttpClientConnection.flush(DefaultBHttpClientConnection.java:185)
   	at org.apache.http.impl.conn.CPoolProxy.flush(CPoolProxy.java:177)
   	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:240)
   	at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doSendRequest(HttpClientSupport.java:498)
   	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:122)
   	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
   	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
   	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
   	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
   	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
   	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
   	at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpClient.doExecute(HttpClientSupport.java:248)
   	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
   	at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:593)
   	at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:661)
   	at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:332)
   	at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:249)
   	at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:130)
   	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
   	at java.util.concurrent.FutureTask.run(Unknown Source)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   	at java.lang.Thread.run(Unknown Source)

Above are the errors, I'm receiving every-time.  

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Hi,

 

Are you using an IP address instead of a hostname in your requests in ReadyAPI?  If so, please use a hostname instead.  

 

Regards,

Marcus James

SmartBear Support



Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

5 REPLIES 5
Highlighted
Community Hero

Hi @arunbharath,

Unfortunately the error response doesnt really tell us much other thsn the http connection was reset.

Connection reset response would typically be cos of the remote endpoint youre hitting and nothing to do with ReadyAPI!

Is there anything that makes you think ReadyAPI! is causing your endpoint to kill the socket?

Could your endpoint be killing the connection cos youre hammering it with ReadyAPI!?

Have you any more data to go on than this?
Can you check the logging on the endpoint youre hitting? There might be some indication why the connection is reset.

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Community Manager

Thank you Richie, great troubleshooting ideas.

 

@arunbharath was the issue solved for you? If not, please provide the Community with more info.


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Contributor

Sorry for late reply. Before trying your approach, I updated my ReadyAPI to 3.2.5. But Unfortunately after my upgrade none of my test case is running. I'm getting below exception

 

Wed May 13 14:39:08 UTC 2020: ERROR: Exception in request: javax.net.ssl.SSLException: Couldn't kickstart handshaking
Wed May 13 14:39:08 UTC 2020: ERROR: An error occurred [Couldn't kickstart handshaking], see error log for details

 

Wed May 13 14:39:08 UTC 2020: ERROR: javax.net.ssl.SSLException: Couldn't kickstart handshaking
   javax.net.ssl.SSLException: Couldn't kickstart handshaking
   	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:127)
   	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:320)
   	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:263)
   	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:405)
   	at java.base/sun.security.ssl.SSLSocketImpl.ensureNegotiated(SSLSocketImpl.java:721)
   	at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:998)
   	at com.eviware.soapui.impl.wsdl.support.http.SoapUILoggingOutputStream.write(SoapUILoggingOutputStream.java:41)
   	at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:126)
   	at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:138)
   	at org.apache.http.impl.io.SessionOutputBufferImpl.flush(SessionOutputBufferImpl.java:146)
   	at org.apache.http.impl.io.ContentLengthOutputStream.flush(ContentLengthOutputStream.java:101)
   	at org.apache.http.entity.ByteArrayEntity.writeTo(ByteArrayEntity.java:117)
   	at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:158)
   	at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:162)
   	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
   	at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doSendRequest(HttpClientSupport.java:504)
   	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:122)
   	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
   	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
   	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
   	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
   	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
   	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
   	at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpClient.doExecute(HttpClientSupport.java:250)
   	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
   	at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:631)
   	at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:605)
   	at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:337)
   	at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:254)
   	at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:130)
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   	at java.base/java.lang.Thread.run(Thread.java:835)
   	Suppressed: java.net.SocketException: Connection reset by peer: socket write error
   		at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
   		at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)
   		at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)
   		at java.base/sun.security.ssl.SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:81)
   		at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:351)
   		... 33 more
   Caused by: java.net.SocketException: Connection reset by peer: socket write error
   	at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
   	at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)
   	at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)
   	at java.base/sun.security.ssl.SSLSocketOutputRecord.flush(SSLSocketOutputRecord.java:251)
   	at java.base/sun.security.ssl.HandshakeOutStream.flush(HandshakeOutStream.java:89)
   	at java.base/sun.security.ssl.ClientHello$ClientHelloKickstartProducer.produce(ClientHello.java:658)
   	at java.base/sun.security.ssl.SSLHandshake.kickstart(SSLHandshake.java:515)
   	at java.base/sun.security.ssl.ClientHandshakeContext.kickstart(ClientHandshakeContext.java:107)
   	at java.base/sun.security.ssl.TransportContext.kickstart(TransportContext.java:227)
   	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:395)
   	... 31 more
Highlighted
Moderator

Hi,

 

Are you using an IP address instead of a hostname in your requests in ReadyAPI?  If so, please use a hostname instead.  

 

Regards,

Marcus James

SmartBear Support



Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

Highlighted
Community Manager

Thanks Marcus!

 

@arunbharath did it work for you?


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get a full Raw JMS request

Participate!

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors