[OVSDB-127] Unable to set the external_ids field of the Qos object Created: 17/Oct/14 Updated: 04/Nov/14 Resolved: 04/Nov/14 |
|
| Status: | Resolved |
| Project: | ovsdb |
| Component/s: | Schemas |
| Affects Version/s: | unspecified |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Jim West | Assignee: | Flavio Fernandes |
| 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: | 2214 |
| Description |
|
For the implementation I'm working on, I need to write some data into the external_ids field of objects in OVSDB's Qos table. I implemented this with the following code: final Qos newQos = ovsdbCfg.createTypedRow(node, Qos.class); However, when I set the external_ids field, I get a NullPointerException deep down in the ovsdb library code. Here's a stack trace: java.lang.NullPointerException Root cause: There a bug in schemas/openvswitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Qos.java What's happening in Insert.java (line 65) is that the columnSchema is null: public <D, C extends TableSchema<C>> Insert<E> value(ColumnSchema<C, D> columnSchema, D value) { Object untypedValue = columnSchema.getNormalizeData(value); row.put(columnSchema.getName(), untypedValue); return this; }This happens because the schema for 'external_ids' can't be found (the schema for other fields CAN be found and if I remove the setting of 'external_ids' the code works correctly. Fix: The fix is to fix the annotation in Qos.java diff --git a/schemas/openvswitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Qos.java b/schemas/openvswitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Q
I've tested this fix and I now get the expected behavior. |
| Comments |
| Comment by Flavio Fernandes [ 04/Nov/14 ] |
|
master: stable/helium: |