[SNMP4J] NullPointerException

Alex Chen achen at packetmotion.com
Thu Apr 20 02:29:25 CEST 2006


I am using the latest 1.7 release of SNMP4J.
I try to run two instances of the program 
org.snmp4j.tools.console.SnmpRequest
on two different machines, one as a trap listener and the other a trap
sender.

Here are the argument lists of the two.
Listener:
-a MD5 -A myPassword -Ol 0.0.0.0/47162

Sender: 
-a MD5 -A myPassword -Ca 172.16.3.36 -Cg 6 -Cs 1234 -Ce 1234 -p TRAP
172.16.1.50/47162


I got the correct messages on both.
Listener:
Listening on 0.0.0.0/47162
TRAP[reqestID=1881841637, errorStatus=0, errorIndex=0,
VBS[1.3.6.1.2.1.1.3.0 = 0:00:00.00; 1.3.6.1.6.3.1.1.4.1.0 =
1.3.6.1.6.3.1.1.5.1]]

Sender: 
TRAP sent successfully

If I set the transport to TCP, i. e.
Listener:
-a MD5 -A myPassword -Ol tcp:0.0.0.0/47162

Sender: 
-a MD5 -A myPassword -Ca 172.16.3.36 -Cg 6 -Cs 1234 -Ce 1234 -p TRAP
tcp:172.16.1.50/47162

I got the following messages:

Listener:
Listening on 0.0.0.0/262
TRAP[reqestID=1813617928, errorStatus=0, errorIndex=0,
VBS[1.3.6.1.2.1.1.3.0 = 0:00:00.00; 1.3.6.1.6.3.1.1.4.1.0 =
1.3.6.1.6.3.1.1.5.1]]

Sender:
java.lang.NullPointerException
	at
org.snmp4j.transport.DefaultTcpTransportMapping.close(DefaultTcpTranspor
tMapping.java:185)
	at org.snmp4j.Snmp.close(Snmp.java:429)
	at
org.snmp4j.tools.console.SnmpRequest.send(SnmpRequest.java:390)
	at
org.snmp4j.tools.console.SnmpRequest.main(SnmpRequest.java:1141)

The listener is a Linux machine running RedHat 9 and the sender machine
is a Windows XP box.





More information about the SNMP4J mailing list