Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-101

YANG Enumeration type is not handled.

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Operating System: Mac OS
      Platform: PC

    • 523

    Description

      2014-03-13 15:12:35 PDT [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/restconf].[JAXRSRestconf]] SEVERE org.apache.catalina.core.StandardWrapperValve invoke Servlet.service() for servlet [JAXRSRestconf] in context with path [/restconf] threw exception [java.util.concurrent.ExecutionException: java.lang.IllegalStateException:
      If a YANG Model contains a leaf of type enumeration, like this:

      leaf node-connector-type {
      type enumeration {
      enum "CTRL"

      { value 0; description "Represents the OFPP_CONTROLLER reserved port to forward a packet to the controller, this is to send data packets to the controller from the data plane triggering a packet_in event."; }

      enum "ALL"

      { value 1; description "Represents the OFPP_ALL reserved OF port to forward to ALL the ports in the system , should be used for flooding like mechanism to be used cautiously to avoid excessive flooding."; }

      And the value is passed in via RestConf as let's say "ALL", then YANGTools fails with the following ClassCastException.

      org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException: java.lang.ClassCastException: java.lang.String cannot be cast to org.opendaylight.yang.gen.v1.urn.opendaylight.host.tracker.rev140305.host.NodeConnector$NodeConnectorType] with root cause
      java.lang.ClassCastException: java.lang.String cannot be cast to org.opendaylight.yang.gen.v1.urn.opendaylight.host.tracker.rev140305.host.NodeConnector$NodeConnectorType
      at org.opendaylight.yang.gen.v1.urn.opendaylight.host.tracker.rev140305.host.NodeConnector$Broker$Codec$DOM.fromDomStatic(NodeConnector$Broker$Codec$DOM.java)
      at org.opendaylight.yang.gen.v1.urn.opendaylight.host.tracker.rev140305.AddStaticHostInput$Broker$Codec$DOM.fromDomStatic(AddStaticHostInput$Broker$Codec$DOM.java)
      at org.opendaylight.yang.gen.v1.urn.opendaylight.host.tracker.rev140305.AddStaticHostInput$Broker$Codec$DOM.deserialize(AddStaticHostInput$Broker$Codec$DOM.java)
      at org.opendaylight.yangtools.sal.binding.generator.impl.LazyGeneratedCodecRegistry$DataContainerCodecImpl.deserialize(LazyGeneratedCodecRegistry.java:629)
      at org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl$11.call(RuntimeGeneratedMappingServiceImpl.java:590)
      at org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl$11.call(RuntimeGeneratedMappingServiceImpl.java:582

      Attachments

        Issue Links

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

          Activity

            People

              mayagarw@cisco.com Mayank Agarwal
              mayagarw@cisco.com Mayank Agarwal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: