Hi Prema,

Most likely, someone is calling Snmp.close() or the close() method of the underlying transport mapping
while other code is still using the same Snmp session.
Another option would be the operating system or JRE closing the socket itself for some reason
(unlikely).

Best regards,
Frank

Am 09.07.2014 20:12, schrieb Prema Upot:
Hi,

We use SNMP4j 1.11 version. Recently we have been seeing a lot of socket closed 
exceptions while sending SNMP get/set messages. We have been using this version 
of SNMP4J for a long time in our application (and we have not modified the way 
we use the SNMP4J API at all) and we have never seen this before. This happens 
when we try to send a set of SNMP requests within a short period of time to 
different hosts (like periodic SNMP polling of a group of devices). Any ideas 
why this is happening ? Once this happens the only way to recover from this 
state is to restart my application.

This is a sample exception that I see in my log file.

[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR: 
java.net.SocketException: Socket is closed
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at java.net.DatagramSocket.send(Unknown Source)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at 
org.snmp4j.transport.DefaultUdpTransportMapping.sendMessage(DefaultUdpTransportMapping.java:115)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at 
org.snmp4j.MessageDispatcherImpl.sendMessage(MessageDispatcherImpl.java:195)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:462)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at org.snmp4j.Snmp.sendMessage(Snmp.java:1078)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at org.snmp4j.Snmp.send(Snmp.java:891)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at org.snmp4j.Snmp.send(Snmp.java:871)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at org.snmp4j.Snmp.send(Snmp.java:836)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at com.optelian.common.SnmpRequest.send(SnmpRequest.java:396)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at com.optelian.common.SnmpRequest.send(SnmpRequest.java:370)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at 
com.optelian.common.OMSSnmp4JDeviceInterface.readFields(OMSSnmp4JDeviceInterface.java:353)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at com.optelian.common.OMSDeviceManager.readFields(OMSDeviceManager.java:74)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at 
com.optelian.topology.server.util.ShelfInterface.readProperties(ShelfInterface.java:220)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at 
com.optelian.topology.server.util.ShelfInterface.readReleaseString(ShelfInterface.java:170)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at 
com.optelian.topology.server.discovery.ShelfPolling.pollOMSNode(ShelfPolling.java:181)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at 
com.optelian.topology.server.discovery.ShelfPolling.run(ShelfPolling.java:63)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[09 Jul 2014 13:44:20:653]  [ polling-11                ] SYS_ERR:              
  at java.lang.Thread.run(Unknown Source)

Any help in debugging this problem is much appreciated.

Thanks,
Prema

_______________________________________________
SNMP4J mailing list
[email protected]
https://oosnmp.net/mailman/listinfo/snmp4j

--
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231

_______________________________________________
SNMP4J mailing list
[email protected]
https://oosnmp.net/mailman/listinfo/snmp4j

Reply via email to