<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:53:39 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>[YANGTOOLS-577] Issue in casting a anyxml leaf to anyXMLNode type</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-577</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;I am getting WARNING when trying to get values of datastore-contents-xml anyxml node for below notification. &lt;/p&gt;

&lt;p&gt;Is there any modification to anyXML implementation? How to convert anyxml data to a DOMSource in current implementation? &lt;/p&gt;

&lt;p&gt;NOTE: It was working fine during Dec time line.&lt;/p&gt;

&lt;p&gt;The value I am getting for below notification looks&lt;br/&gt;
2016-01-26 15:58:47,020 | INFO  | oupCloseable-5-2 | YangpushDOMNotificationListener  | 247 - org.opendaylight.yang-push.yangpush-impl - 1.1.0.SNAPSHOT | Notification recieved ImmutableContainerNode{nodeIdentifier=(urn:ietf:params:xml:ns:yang:ietf-datastore-push?revision=2015-10-15)push-update, value=[ImmutableLeafNode{nodeIdentifier=(urn:ietf:params:xml:ns:yang:ietf-datastore-push?revision=2015-10-15)time-of-update, value=2011-01-04T12:30:46Z, attributes={}}, ImmutableLeafNode{nodeIdentifier=(urn:ietf:params:xml:ns:yang:ietf-datastore-push?revision=2015-10-15)subscription-id, value=201, attributes={}}, ImmutableChoiceNode{nodeIdentifier=(urn:ietf:params:xml:ns:yang:ietf-datastore-push?revision=2015-10-15)encoding, value=&lt;span class=&quot;error&quot;&gt;&amp;#91;ImmutableLeafNode{nodeIdentifier=(urn:ietf:params:xml:ns:yang:ietf-datastore-push?revision=2015-10-15)datastore-contents-xml, value=actMgmtEth0/0/CPU0/010.0.2.15255.255.255.0, attributes={}}&amp;#93;&lt;/span&gt;}], attributes={}}&lt;/p&gt;

&lt;p&gt;2016-01-26 15:58:47,021 | WARN  | oupCloseable-5-2 | YangpushDOMNotificationListener  | 247 - org.opendaylight.yang-push.yangpush-impl - 1.1.0.SNAPSHOT | java.lang.ClassCastException: org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder$ImmutableLeafNode cannot be cast to org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode&lt;/p&gt;


&lt;p&gt;Notification schema:&lt;br/&gt;
     notification push-update {&lt;br/&gt;
       leaf subscription-id &lt;/p&gt;
{
         type subscription-id;
         mandatory true;
       }
&lt;p&gt;       leaf time-of-update &lt;/p&gt;
{
         type yang:date-and-time;
       }
&lt;p&gt;      choice encoding {&lt;br/&gt;
         case encode-xml &lt;/p&gt;
{
             anyxml datastore-contents-xml;
         }
&lt;p&gt;         case encode-json {&lt;br/&gt;
           if-feature json;&lt;br/&gt;
           leaf datastore-contents-json &lt;/p&gt;
{
             type datastore-contents-json;
           }
&lt;p&gt;         }&lt;br/&gt;
       }&lt;br/&gt;
     }&lt;/p&gt;

&lt;p&gt;Sample code:&lt;br/&gt;
   private void pushUpdateHandlder(DOMNotification notification) {&lt;br/&gt;
        ContainerNode conNode = notification.getBody();&lt;br/&gt;
        ChoiceNode valueNode = null;&lt;br/&gt;
        AnyXmlNode anyXmlValue = null;&lt;br/&gt;
        DOMSource domSource = null;&lt;br/&gt;
        String sub_id = &quot;&quot;;&lt;br/&gt;
        String timeofeventupdate = &quot;&quot;;&lt;br/&gt;
        try &lt;/p&gt;
{
            sub_id = conNode.getChild(subid).get().getValue().toString();
            timeofeventupdate = conNode.getChild(timeofevent).get().getValue().toString();
            valueNode = (ChoiceNode) conNode.getChild(encoding).get();
            anyXmlValue = (AnyXmlNode) valueNode.getChild(contents).get();
            domSource = anyXmlValue.getValue();
        }
&lt;p&gt; catch (Exception e) &lt;/p&gt;
{
            LOG.warn(e.toString());
        }
&lt;p&gt;        String notificationAsString = domSourceToString(domSource);&lt;br/&gt;
        LOG.info(&quot;Notification recieved for sub_id :{} at : {}:\n {}&quot;, sub_id, timeofeventupdate, notificationAsString);&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="22997">YANGTOOLS-577</key>
            <summary>Issue in casting a anyxml leaf to anyXMLNode type</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="10003">Cannot Reproduce</resolution>
                                        <assignee username="ifoltin">Igor Foltin</assignee>
                                    <reporter username="ambika.tripathy@cisco.com">Ambika Prasad Tripathy</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Jan 2016 11:19:01 +0000</created>
                <updated>Sun, 10 Apr 2022 18:35:44 +0000</updated>
                            <resolved>Tue, 19 Jul 2016 16:57:02 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="43725" author="tony.tkacik@gmail.com" created="Wed, 27 Jan 2016 10:32:29 +0000"  >&lt;p&gt;Which branch are you observing this issue?&lt;br/&gt;
Are you building YANGTOOls locally or downloaded from repository?&lt;/p&gt;</comment>
                            <comment id="43726" author="ambika.tripathy@cisco.com" created="Wed, 27 Jan 2016 15:23:47 +0000"  >&lt;p&gt;I am downloading from latest repo.&lt;/p&gt;</comment>
                            <comment id="43727" author="ambika.tripathy@cisco.com" created="Wed, 11 May 2016 18:36:00 +0000"  >&lt;p&gt;Would you link to update the release plan for the bug and work arround?&lt;/p&gt;</comment>
                            <comment id="43728" author="ambika.tripathy@cisco.com" created="Tue, 7 Jun 2016 12:47:26 +0000"  >&lt;p&gt;for anyxml node, it is not mandatory to define a schema node. I can put any XML data inside it for which schema may not present. Why the current  implementation of anyXML depends on schema? &lt;/p&gt;

&lt;p&gt;is the schema is not there, how to get DOMSource from the ANYXML leaf node?&lt;/p&gt;</comment>
                            <comment id="43729" author="ifoltin" created="Mon, 13 Jun 2016 07:29:42 +0000"  >&lt;p&gt;Hello Ambika,&lt;/p&gt;

&lt;p&gt;I would like to ask: How did you construct the DOMNotification object ? Which implementation did you use ?&lt;/p&gt;

&lt;p&gt;According to the ClassCastException message, it seems like you put a LeafNode under the ChoiceNode &quot;encoding&quot;.&lt;br/&gt;
You have to put an AnyXmlNode in there instead as it represents the anyxml schema node &quot;datastore-contents-xml&quot; from the yang schema.&lt;/p&gt;</comment>
                            <comment id="43730" author="ambika.tripathy@cisco.com" created="Mon, 13 Jun 2016 08:42:02 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;my choice node is like below&lt;br/&gt;
      choice encoding {&lt;br/&gt;
         case encode-xml &lt;/p&gt;
{
             anyxml datastore-contents-xml;
         }

&lt;p&gt;The notification generated by Device and received by ODL. I am getting proper notification message from device. But when extracting &quot;datastore-contents-xml&quot; node contents, i am facing the issue.&lt;/p&gt;

&lt;p&gt;br,&lt;br/&gt;
Ambika Prasad Tripathy&lt;/p&gt;</comment>
                            <comment id="43731" author="ifoltin" created="Mon, 13 Jun 2016 13:07:40 +0000"  >&lt;p&gt;Could you please provide more info about the exact conditions under which you ran into this problem ? I will then try to reproduce it.&lt;/p&gt;</comment>
                            <comment id="43732" author="rgoulding" created="Tue, 5 Jul 2016 16:20:19 +0000"  >&lt;p&gt;Hi Ambika,&lt;/p&gt;

&lt;p&gt;Have you gotten a chance to provide any more information to reproduce this issue?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Ryan&lt;/p&gt;</comment>
                            <comment id="43733" author="ambika.tripathy@cisco.com" created="Thu, 7 Jul 2016 05:13:24 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Sorry. I missed last notification. &lt;/p&gt;

&lt;p&gt;If you look my model for anyxml use, i have no predefined schema assigned for the anyxml data node.&lt;/p&gt;

&lt;p&gt;I am expecting this node to handle all different kind of data tree (any namespaces) received from device. say in first notification message i can expect interface module data tree populated in node datastore-contents-xml and in second notification message it can be QoS module data tree.  &lt;/p&gt;

&lt;p&gt;      choice encoding {&lt;br/&gt;
         case encode-xml &lt;/p&gt;
{
             anyxml datastore-contents-xml;
         }
&lt;p&gt;So, during design time, i have no idea which schema to assign for anyxml. &lt;/p&gt;

&lt;p&gt;This feature was working fine post beryllium release.&lt;/p&gt;

&lt;p&gt;br,&lt;br/&gt;
Ambika Prasad Tripathy&lt;/p&gt;</comment>
                            <comment id="43734" author="ifoltin" created="Wed, 13 Jul 2016 10:09:42 +0000"  >&lt;p&gt;Hi Ambika, you need to have a schema assigned just for the anyxml element itself, not for its contents.&lt;/p&gt;

&lt;p&gt;Moreover, I still do not have enough info to reproduce the issue.&lt;/p&gt;

&lt;p&gt;Maybe you could upload a patch with a unit test which would show how exactly does the issue occur.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Igor&lt;/p&gt;</comment>
                            <comment id="43735" author="rgoulding" created="Tue, 19 Jul 2016 16:57:02 +0000"  >&lt;p&gt;Casting a leaf as anyxml is not supported.  If you have further information to provide, please add a comment and we can re-open this bug.&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>5099</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=5099]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10204" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>ODL SR Target Milestone</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10341"><![CDATA[Beryllium-3]]></customfieldvalue>

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

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