Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-5695

[YMS-Integration] YMS exception when converting RESTCONF notification payload into YO

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: None
    • Labels:
      None
    • Story Points:
      2

      Description

      The following is the input notification JSON payload:

      2016-11-25 14:48:45,017 | INFO | ool-119-thread-3 | TeTopologyRestconfProvider | 191 - org.onosproject.onos-ietfte-provider-topology - 1.8.0.SNAPSHOT | nodeString={"ietf-te-topology:event-type":"update","ietf-te-topology:node-ref":"HUAWEI_ROADM_1","ietf-te-topology:te-node-attributes":{"ietf-te-topology:connectivity-matrix":[{"ietf-te-topology:id":"1","ietf-te-topology:is-allowed":"true","ietf-te-topology:from":

      {"ietf-te-topology:tp-ref":"CLIENT1_NODE1"}

      ,"ietf-te-topology:to":{"ietf-te-topology:tp-ref":"LINE1_NODE1"}}]}}

      When converting the above "nodeString" into YO, the following exception is raised:

      onos> Exception in thread "pool-119-thread-3" org.onosproject.yms.app.yob.exception.YobException: Failed to get field for class: org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.IetfTeTopologyOpParam$IetfTeTopologyBuilder
      at org.onosproject.yms.app.yob.YobWorkBench.setObjectInBuilder(YobWorkBench.java:154)
      at org.onosproject.yms.app.yob.YobWorkBench.setObject(YobWorkBench.java:478)
      at org.onosproject.yms.app.yob.YobHandler.setInParent(YobHandler.java:79)
      at org.onosproject.yms.app.yob.YobListener.exitYdtNode(YobListener.java:81)
      at org.onosproject.yms.app.ydt.DefaultYdtWalker.exitCallBack(DefaultYdtWalker.java:114)
      at org.onosproject.yms.app.ydt.DefaultYdtWalker.walkTree(DefaultYdtWalker.java:84)
      at org.onosproject.yms.app.ydt.DefaultYdtWalker.walk(DefaultYdtWalker.java:123)
      at org.onosproject.yms.app.yob.DefaultYobBuilder.getYangObject(DefaultYobBuilder.java:46)
      at org.onosproject.yms.app.ych.DefaultYangCodecHandler.getObjectList(DefaultYangCodecHandler.java:251)
      at org.onosproject.yms.app.ych.DefaultYangCodecHandler.decode(DefaultYangCodecHandler.java:219)
      at org.onosproject.provider.te.topology.TeTopologyRestconfProvider$InternalRestconfNotificationEventListener.handleNotificationEvent(TeTopologyRestconfProvider.java:322)
      at org.onosproject.provider.te.topology.TeTopologyRestconfProvider$InternalRestconfNotificationEventListener.handleNotificationEvent(TeTopologyRestconfProvider.java:292)
      at org.onosproject.protocol.restconf.ctl.RestConfSBControllerImpl$GetChunksRunnable.run(RestConfSBControllerImpl.java:224)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)

      onos>
      onos>

      The source code is:

      String teEventString = removePrefixTagFromJson(eventJsonString, TE_NOTIFICATION_PREFIX);
      YangCompositeEncodingImpl yce = null;
      if (teEventString.startsWith(TE_LINK_EVENT_PREFIX)) {
      String linkString = removePrefixTagFromJson(teEventString, TE_LINK_EVENT_PREFIX);
      log.info("linkString={}", linkString);
      yce = new YangCompositeEncodingImpl(YangResourceIdentifierType.URI,
      "ietf-te-topology:te-link-event",
      linkString);
      } else if (teEventString.startsWith(TE_NODE_EVENT_PREFIX)) {
      String nodeString = removePrefixTagFromJson(teEventString, TE_NODE_EVENT_PREFIX);
      log.info("nodeString={}", nodeString);
      yce = new YangCompositeEncodingImpl(YangResourceIdentifierType.URI,
      "ietf-te-topology:te-node-event",
      nodeString);
      }

      Object yo = codecHandler.decode(yce,
      YangProtocolEncodingFormat.JSON,
      YmsOperationType.NOTIFICATION);

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            hyu2010 Henry Yu
            Reporter:
            hyu2010 Henry Yu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: