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

YANG Parser (sometimes) has Source: null, making it hard to track which source model file an error is in

    XMLWordPrintable

Details

    • Bug
    • Status: Verified
    • Resolution: Done
    • None
    • 2.0.0
    • None
    • None
    • Operating System: All
      Platform: All

    • 5881

    Description

      In some cases at least, when the yangtools yang parser fails, it does not say WHERE (while processing WHICH *.yang file) it fell over. Strangely, I have seen a case (see below) where it gives a line / column information, but not which model file.

      I'll see if I can contribute a change to address this.

      [main] ERROR org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor - yang-to-sources: Unable to parse yang files from /home/vorburger/dev/ODL/git/controller/opendaylight/md-sal/samples/toaster-consumer/src/main/yang
      java.lang.IllegalArgumentException: config:disable-osgi-service-registration is not a YANG statement or use of extension. Source: null:19:9
      at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
      at org.opendaylight.yangtools.yang.parser.impl.YangStatementParserListenerImpl.enterStatement(YangStatementParserListenerImpl.java:88)
      at org.opendaylight.yangtools.antlrv4.code.gen.YangStatementParser$StatementContext.enterRule(YangStatementParser.java:113)
      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.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangStatementSourceImpl.writeFull(YangStatementSourceImpl.java:94)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.SourceSpecificContext.loadStatements(SourceSpecificContext.java:320)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.loadPhaseStatements(BuildGlobalContext.java:206)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.buildEffective(BuildGlobalContext.java:174)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor$BuildAction.buildEffective(CrossSourceStatementReactor.java:105)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor$BuildAction.buildEffective(CrossSourceStatementReactor.java:123)
      at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.processYang(YangToSourcesProcessor.java:169)
      at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.execute(YangToSourcesProcessor.java:93)
      at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesMojo.execute(YangToSourcesMojo.java:116)

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            vorburger Michael Vorburger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: