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

Parser exception for invalid path in leafref.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      None
    • Story Points:
      2

      Description

      Defect : Parser exception for invalid path in leafref.

      Yang :
      module moduletest {
      yang-version 1;
      namespace "onos-yang-19:level1:newlevel";
      prefix test;

      organization "huawei";
      contact "adarsh.m@huawei.com";
      description "leaf scenario";

      revision 2015-02-05;
      list company1{
      key company-id;
      leaf company-id

      { type int16; }

      }

      list employee {
      key employee-id;
      leaf employee-id

      { type int8; }

      leaf company {
      type leafref

      { path "company/company-id"; }

      }
      }

      }

      Logs :
      mvn clean install
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building onlab-test 1.7.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] — maven-clean-plugin:2.5:clean (default-clean) @ onlab-test —
      [INFO] Deleting /opt/onos-master/onos/utils/test/target
      [INFO]
      [INFO] — jacoco-maven-plugin:0.7.5.201505241946:prepare-agent (default-prepare-agent) @ onlab-test —
      [INFO] argLine set to -javaagent:/home/root1/.m2/repository/org/jacoco/org.jacoco.agent/0.7.5.201505241946/org.jacoco.agent-0.7.5.201505241946-runtime.jar=destfile=/opt/onos-master/onos/utils/test/target/jacoco.exec -Duser.language=en -Duser.region=US
      [INFO]
      [INFO] — yangutils-maven-plugin:1.0.0-SNAPSHOT:yang2java (default) @ onlab-test —
      [INFO] Error in file: /opt/onos-master/onos/utils/test/src/main/yang/negnum (another copy).yang at line: 25 at position: 9
      YANG file error : pathcompany/company-id does not follow valid path syntax
      [INFO]
      org.onosproject.yangutils.parser.exceptions.ParserException: YANG file error : pathcompany/company-id does not follow valid path syntax
      at org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.validatePathArgument(ListenerUtil.java:413)
      at org.onosproject.yangutils.parser.impl.listeners.PathListener.processPathEntry(PathListener.java:83)
      at org.onosproject.yangutils.parser.impl.TreeWalkListener.enterPathStatement(TreeWalkListener.java:686)
      at org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser$PathStatementContext.enterRule(GeneratedYangParser.java:9750)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:66)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:49)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:52)
      at org.onosproject.yangutils.parser.impl.YangUtilsParserManager.getDataModel(YangUtilsParserManager.java:91)
      at org.onosproject.yangutils.plugin.manager.YangUtilManager.parseYangFileInfoSet(YangUtilManager.java:288)
      at org.onosproject.yangutils.plugin.manager.YangUtilManager.execute(YangUtilManager.java:187)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 2.546 s
      [INFO] Finished at: 2016-07-05T15:15:07+05:30
      [INFO] Final Memory: 20M/314M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.onosproject:yangutils-maven-plugin:1.0.0-SNAPSHOT:yang2java (default) on project onlab-test: Exception occured due to YANG file error : pathcompany/company-id does not follow valid path syntax in /opt/onos-master/onos/utils/test/src/main/yang/negnum (another copy).yang YANG file. -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
      root1@root1-HP-EliteBook-840-G2:/opt/onos-master/onos/utils/test$

        Attachments

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

          Activity

            People

            Assignee:
            janani Janani B
            Reporter:
            huawei-adarsh Adarsh m
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: