<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:35:34 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[OVSDB-127] Unable to set the external_ids field of the Qos object</title>
                <link>https://jira.opendaylight.org/browse/OVSDB-127</link>
                <project id="10158" key="OVSDB">ovsdb</project>
                    <description>&lt;p&gt;For the implementation I&apos;m working on, I need to write some data into the external_ids field of objects in OVSDB&apos;s Qos table.&lt;/p&gt;

&lt;p&gt;I implemented this with the following code:&lt;/p&gt;

&lt;p&gt;      final Qos             newQos  = ovsdbCfg.createTypedRow(node, Qos.class);&lt;br/&gt;
      final HashSet&amp;lt;String&amp;gt; typeSet = new HashSet&amp;lt;String&amp;gt;();&lt;br/&gt;
      typeSet.add(MY_QOS_TYPE);&lt;br/&gt;
      newQos.setType(typeSet);&lt;br/&gt;
      final HashMap&amp;lt;String, String&amp;gt; extIds  = new HashMap&amp;lt;&amp;gt;();&lt;br/&gt;
      extIds.put(QOS_ATTR, attrValue);&lt;br/&gt;
      newQos.setExternalIds(extIds);&lt;br/&gt;
      final StatusWithUuid status = ovsdbCfg.insertRow(ovsNode, tableName, parentUuid, row);&lt;/p&gt;

&lt;p&gt;However, when I set the external_ids field, I get a NullPointerException deep down in the ovsdb library code.  Here&apos;s a stack trace:&lt;/p&gt;

&lt;p&gt;java.lang.NullPointerException&lt;br/&gt;
        at org.opendaylight.ovsdb.lib.operations.Insert.value(Insert.java:65)&lt;br/&gt;
        at org.opendaylight.ovsdb.lib.operations.Insert.value(Insert.java:73)&lt;br/&gt;
        at org.opendaylight.ovsdb.lib.operations.Insert.&amp;lt;init&amp;gt;(Insert.java:56)&lt;br/&gt;
        at org.opendaylight.ovsdb.lib.operations.Operations.insert(Operations.java:31)&lt;br/&gt;
        at org.opendaylight.ovsdb.plugin.impl.ConfigurationServiceImpl.processInsertTransaction(ConfigurationServiceImpl.java:1205)&lt;br/&gt;
        at org.opendaylight.ovsdb.plugin.impl.ConfigurationServiceImpl.processTypedInsertTransaction(ConfigurationServiceImpl.java:209)&lt;br/&gt;
        at org.opendaylight.ovsdb.plugin.impl.ConfigurationServiceImpl.insertRow(ConfigurationServiceImpl.java:265)&lt;/p&gt;

&lt;p&gt;Root cause:&lt;/p&gt;

&lt;p&gt;There a bug in schemas/openvswitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Qos.java&lt;/p&gt;

&lt;p&gt;What&apos;s happening in Insert.java (line 65) is that the columnSchema is null:&lt;/p&gt;

&lt;p&gt;    public &amp;lt;D, C extends TableSchema&amp;lt;C&amp;gt;&amp;gt; Insert&amp;lt;E&amp;gt; value(ColumnSchema&amp;lt;C, D&amp;gt; columnSchema, D value) &lt;/p&gt;
{
        Object untypedValue = columnSchema.getNormalizeData(value);
        row.put(columnSchema.getName(), untypedValue);
        return this;
    }

&lt;p&gt;This happens because the schema for &apos;external_ids&apos; can&apos;t be found (the schema for other fields CAN be found and if I remove the setting of &apos;external_ids&apos; the code works correctly.&lt;/p&gt;

&lt;p&gt;Fix:&lt;/p&gt;

&lt;p&gt;The fix is to fix the annotation in Qos.java&lt;/p&gt;

&lt;p&gt;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&lt;br/&gt;
index b853ede..3c4896f 100644&lt;br/&gt;
&amp;#8212; a/schemas/openvswitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Qos.java&lt;br/&gt;
+++ b/schemas/openvswitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Qos.java&lt;br/&gt;
@@ -45,9 +45,9 @@ public interface Qos extends TypedBaseTable&amp;lt;GenericTableSchema&amp;gt; {&lt;br/&gt;
     @TypedColumn (name=&quot;other_config&quot;, method= MethodType.SETDATA, fromVersion=&quot;1.0.0&quot;)&lt;br/&gt;
     public void setOtherConfig(Map&amp;lt;String, String&amp;gt; otherConfig) ;&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;@TypedColumn (name=&quot;externalIds&quot;, method= MethodType.GETCOLUMN, fromVersion=&quot;1.0.0&quot;)&lt;br/&gt;
+    @TypedColumn (name=&quot;external_ids&quot;, method= MethodType.GETCOLUMN, fromVersion=&quot;1.0.0&quot;)&lt;br/&gt;
     public Column&amp;lt;GenericTableSchema, Map&amp;lt;String, String&amp;gt;&amp;gt; getExternalIdsColumn() ;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;@TypedColumn (name=&quot;externalIds&quot;, method= MethodType.SETDATA, fromVersion=&quot;1.0.0&quot;)&lt;br/&gt;
+    @TypedColumn (name=&quot;external_ids&quot;, method= MethodType.SETDATA, fromVersion=&quot;1.0.0&quot;)&lt;br/&gt;
     public void setExternalIds(Map&amp;lt;String, String&amp;gt; externalIds) ;&lt;br/&gt;
}&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I&apos;ve tested this fix and I now get the expected behavior.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="21819">OVSDB-127</key>
            <summary>Unable to set the external_ids field of the Qos object</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="flavio@flaviof.com">Flavio Fernandes</assignee>
                                    <reporter username="jimw@a-bb.net">Jim West</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Oct 2014 15:25:49 +0000</created>
                <updated>Tue, 4 Nov 2014 13:18:57 +0000</updated>
                            <resolved>Tue, 4 Nov 2014 13:18:57 +0000</resolved>
                                    <version>unspecified</version>
                                                    <component>Schemas</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="40746" author="flavio@flaviof.com" created="Tue, 4 Nov 2014 13:18:57 +0000"  >&lt;p&gt;master:&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/12465/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/12465/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;stable/helium:&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/12487/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/12487/&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2214</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=2214]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i020tb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>