SNMP binding generating Null pointer exceptions

I’m using 2.0RC1 and am trying to setup the SNMP binding for me. I’m reading a few ifAdmin and ifOper states from my in house network equipment.

The binding generates a lot of NPEs like:

2017-01-22 12:01:25.526 [INFO ] [b.core.service.AbstractActiveService] - SNMP Refresh Service has been started
2017-01-22 12:01:25.536 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread SNMP Refresh Service
at org.snmp4j.MessageDispatcherImpl.getTransport([235:org.openhab.binding.snmp:1.9.0.RC1]
at org.snmp4j.MessageDispatcherImpl.sendPdu([235:org.openhab.binding.snmp:1.9.0.RC1]
at org.snmp4j.Snmp.sendMessage([235:org.openhab.binding.snmp:1.9.0.RC1]
at org.snmp4j.Snmp.send([235:org.openhab.binding.snmp:1.9.0.RC1]
at org.snmp4j.Snmp.send([235:org.openhab.binding.snmp:1.9.0.RC1]
at org.openhab.binding.snmp.internal.SnmpBinding.sendPDU([235:org.openhab.binding.snmp:1.9.0.RC1]
at org.openhab.binding.snmp.internal.SnmpBinding.execute([235:org.openhab.binding.snmp:1.9.0.RC1]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute([176:org.openhab.core.compat1x:2.0.0.RC1]
at org.openhab.core.service.AbstractActiveService$[176:org.openhab.core.compat1x:2.0.0.RC1]

The snmp communication works flawlessly though, i am able to send out proper SET requests and also GETs seem to work.

The only thing i define in snmp.cfg is:


A sample item definition looks like this:

Switch sw1_P3 “sw1_en03: Port3” (sw1) { snmp="<[] >[OFF:192.168.1.x:private:.] >[ON:192.168.1.x:private:.]" }

I can also see from netstat that the binding has successfully attached itself to port 16200, and there are also no binding errors pointing to this being an issue.

Generated a github isse: