Solved: java.net.SocketTimeoutException: connect timed out... - ServiceNow Community

java.net.SocketTimeoutException: connect timed out Error

Savita1
Giga Contributor

Hi,

Can someone help me n explaining the below error which I am getting in my Solarwind Integration.

01/10/20 08:41:21 (597) ECCQueueMonitor.40 SEVERE *** ERROR *** getRecords failed (java.net.SocketTimeoutException: connect timed out)

 

and also the Solarwinds monitor crashes again and again.

 

What could be the possible reason for this?

 

Thanks

1 ACCEPTED SOLUTION

moshe_d
ServiceNow Employee
ServiceNow Employee

Hi

Where do u see this error?

if u see this on the mid logs i believe that this is becuase SN couldn't get the records (events) to the instance
try to first click on the test connector and check the result

p.s. dont forget to fill the connector paramters (port etc.)

 

Regards ,Moshe

  • Add to Phrasebook
     
    • No word lists for English -> Hebrew...
       
    • Create a new word list...
  • Copy
  • Add to Phrasebook
     
    • No word lists for English -> Hebrew...
       
    • Create a new word list...
  • Copy

View solution in original post

3 REPLIES 3

Sumanth16
Kilo Patron

moshe_d
ServiceNow Employee
ServiceNow Employee

Hi

Where do u see this error?

if u see this on the mid logs i believe that this is becuase SN couldn't get the records (events) to the instance
try to first click on the test connector and check the result

p.s. dont forget to fill the connector paramters (port etc.)

 

Regards ,Moshe

  • Add to Phrasebook
     
    • No word lists for English -> Hebrew...
       
    • Create a new word list...
  • Copy
  • Add to Phrasebook
     
    • No word lists for English -> Hebrew...
       
    • Create a new word list...
  • Copy

elonvengas
Kilo Explorer

Your Java socket is timing out 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.

  • Server is slow and default timeout is less, so just put timeout value according to you.
  • Server is working fine but timeout value is for less time. so change the timeout value.

Solution: A 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);