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
java.lang.NullPointerException
at org.snmp4j.MessageDispatcherImpl.getTransport(MessageDispatcherImpl.java:219)[235:org.openhab.binding.snmp:1.9.0.RC1]
at org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:427)[235:org.openhab.binding.snmp:1.9.0.RC1]
at org.snmp4j.Snmp.sendMessage(Snmp.java:1004)[235:org.openhab.binding.snmp:1.9.0.RC1]
at org.snmp4j.Snmp.send(Snmp.java:974)[235:org.openhab.binding.snmp:1.9.0.RC1]
at org.snmp4j.Snmp.send(Snmp.java:958)[235:org.openhab.binding.snmp:1.9.0.RC1]
at org.openhab.binding.snmp.internal.SnmpBinding.sendPDU(SnmpBinding.java:443)[235:org.openhab.binding.snmp:1.9.0.RC1]
at org.openhab.binding.snmp.internal.SnmpBinding.execute(SnmpBinding.java:354)[235:org.openhab.binding.snmp:1.9.0.RC1]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:157)[176:org.openhab.core.compat1x:2.0.0.RC1]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173)[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:

port=16200

A sample item definition looks like this:

Switch sw1_P3 “sw1_en03: Port3” (sw1) { snmp=“<[192.168.192.1.x:public:.1.3.6.1.2.1.2.2.1.8.3:300000:MAP(SwitchState.map)] >[OFF:192.168.1.x:private:.1.3.6.1.2.1.2.2.1.7.3:2] >[ON:192.168.1.x:private:.1.3.6.1.2.1.2.2.1.7.3:1]” }

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:
https://github.com/openhab/openhab1-addons/issues/5027