[SNMP4SDN-12] Java.lang.NullPointerException error occured when executing command snmp4sdn:topodiscoverswitches Created: 30/Oct/15 Updated: 19/Oct/17 Resolved: 02/Mar/16 |
|
| Status: | Resolved |
| Project: | snmp4sdn |
| Component/s: | General |
| Affects Version/s: | unspecified |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Nanfei Chen | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 4559 |
| Description |
|
Three switches are used in my experiment, and the connection between them is as follows: s1(GE1/0/1)----- Firstly, I use command snmp4sdn:readdb to read the device information of s1 and s2, and the detailed information is as follows: MAC,IP,SNMP_Community,CLI_Username,CLI_Password Then, I use command snmp4sdn:topodiscoverswitches to discovery the two switches. But there is an ERROR log of java.lang.NullPointerException after executing the command snmp4sdn:topodiscoverswitches. The detailed information is as follows: 2015-10-29 20:07:24,671 | INFO | l for user karaf | CmethUtil | 270 - org.opendaylight.snmp4sdn - 0.2.1.Lithium-SR1 | enter CmethUtil.readDB() |
| Comments |
| Comment by Christine Hsieh [ 15/Feb/16 ] |
|
The topology could be collected as you experimented in |
| Comment by Nanfei Chen [ 15/Feb/16 ] |
|
When I did the experiments, the problem always occured when executing the command. |
| Comment by Nanfei Chen [ 23/Feb/16 ] |
|
I have submitted a change for this bug. |
| Comment by Christine Hsieh [ 28/Feb/16 ] |
|
See the patch, agree that we missed to check null pointer. But I wonder why it fixes the problem, could you simply explain why? |
| Comment by Nanfei Chen [ 29/Feb/16 ] |
|
Sorry about my careless of no description. There was a problem in method run of class TopologyNotify. When I traced the code, I found there was such a container whose ITopologyServiceShimListener in map topologyServiceShimListeners was null. And then, the method edgeUpdate of this null ITopologyServiceShimListener was called without checking whether it was null, so the Java.lang.NullPointerException error occured. When I checked whether the ITopologyServiceShimListener corresponding to every container was null before calling its method edgeUpdate, there was not Java.lang.NullPointerException error any more. |
| Comment by Christine Hsieh [ 02/Mar/16 ] |
|
I see, thanks for your fixing, code is merged now. |