[SNMP4J] stack dump on stdout

Frank Fock fock at agentpp.com
Tue Aug 6 22:35:01 CEST 2013


Hi,

In this special case, you should try to avoid the source error.
The error is printed, because it happens in a Thread that was
started by the DefaultUdpTransportMapping. Since
there is no caller of that run() method, it stack is printed out.

You can avoid this by warpping the ListenerThread yourself
(by subclassing the DefaultUdpTransportMapping).

Otherwise, you have to use:
SNMP4JSettings.setForwardRuntimeExceptions(false);

Best regards,
Frank


Am 06.08.2013 10:17, schrieb Fabrice Bacchella:
> I'm gettint this stack thrown on stdout :
> Exception in thread "DefaultUDPTransportMapping_192.168.1.22/0" java.lang.RuntimeException: java.net.SocketException: Socket closed
> 	at org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread.run(DefaultUdpTransportMapping.java:429)
> 	at java.lang.Thread.run(Thread.java:722)
> Caused by: java.net.SocketException: Socket closed
> 	at java.net.PlainDatagramSocketImpl.receive0(Native Method)
> 	at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:145)
> 	at java.net.DatagramSocket.receive(DatagramSocket.java:786)
> 	at org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread.run(DefaultUdpTransportMapping.java:375)
> 	... 1 more
>
> It's shown when I'm setting:
> SNMP4JSettings.setForwardRuntimeExceptions(true);
>
> Any idea how can I prevent it getting printed ? I excepted this setting to send internal snmp4j's exceptions up to my application, not to print them on screen.
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

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




More information about the SNMP4J mailing list