[SNMP4J] suddent error coming out of nowhere

FLORENT Philippe Philippe.FLORENT at edenred.com
Mon Dec 12 12:01:35 CET 2016


Hi,

Suddently my collegue have issues with the app I ve written (works perfectly fine on my pc)
I rebooted his pc, but still the same

java.lang.NullPointerException
                at java.util.Hashtable.remove(Unknown Source)
                at org.snmp4j.mp.MPv3.removeEngineID(MPv3.java:356)
                at org.snmp4j.Snmp.discoverAuthoritativeEngineID(Snmp.java:1177)
                at starrwarr.remote.snmp.SnmpProber.Connect(SnmpProber.java:93)
                at starrwarr.Machine.run(Machine.java:97)
                at java.lang.Thread.run(Unknown Source)

this was not occurring before and I cant figure out what's going wrong

here is the code I use :

                    TransportMapping transport = new DefaultUdpTransportMapping();
                    snmp = new Snmp(transport);
                    USM usm = new USM(SecurityProtocols.getInstance(),new OctetString(MPv3.createLocalEngineID()), 0);
                    SecurityModels.getInstance().addSecurityModel(usm);
                    transport.listen();
                    snmp.listen();

            Address targetAddress = GenericAddress.parse("udp:"+ipAddress+"/"+port);
            target = new UserTarget();
            target.setAddress(targetAddress);
            target.setRetries(1);
            target.setTimeout(5000);
            target.setVersion(SnmpConstants.version3);
            target.setSecurityLevel(SecurityLevel.AUTH_PRIV);
            target.setSecurityName(new OctetString(userName));

thanks



More information about the SNMP4J mailing list