Java fiailed to gen code from YANG

asked 2015-08-14 10:09:36 -0700

anonymous user

Anonymous

updated 2015-08-30 15:03:41 -0700

Robert Varga gravatar image

Hello,

I have got myself up on ruunning with maven and Opendaylight's archtype.

so i have start to port the Yang model bit by bit. I'm told the yang code compiles as part of confD build, but when i try to compile it as part of Opendaylight i get the following error :

  ubuntu@turn:~/tmp/turnserverd/impl$ mvn clean install -DskipTests
   [ERROR] yang-to-sources: Unable to generate sources with   org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl generator
  [ERROR] yang-to-sources: One or more code generators failed, including failed list(generatorClass=exception)  {org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl=java.lang.IllegalStateException}
  [ERROR] Failed to execute goal org.opendaylight.yangtools:yang-maven-plugin:0.7.0-SNAPSHOT:generate-sources (binding) on project turnserverd-impl: yang-to-sources: One or more code generators failed, including failed  list(generatorClass=exception)  {org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl=java.lang.IllegalStateException} -> [Help 1]
    at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.generateTypesFromChoiceCases(BindingGeneratorImpl.java:1245)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.choiceToGeneratedType(BindingGeneratorImpl.java:1171)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.addSchemaNodeToBuilderAsMethod(BindingGeneratorImpl.java:1127)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.resolveDataSchemaNodes(BindingGeneratorImpl.java:1056)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.containerToGenType(BindingGeneratorImpl.java:335)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.addSchemaNodeToBuilderAsMethod(BindingGeneratorImpl.java:1123)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.resolveDataSchemaNodes(BindingGeneratorImpl.java:1056)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.containerToGenType(BindingGeneratorImpl.java:335)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.addSchemaNodeToBuilderAsMethod(BindingGeneratorImpl.java:1123)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.resolveDataSchemaNodes(BindingGeneratorImpl.java:1056)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.generateTypesFromChoiceCases(BindingGeneratorImpl.java:1251)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.choiceToGeneratedType(BindingGeneratorImpl.java:1171)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.addSchemaNodeToBuilderAsMethod(BindingGeneratorImpl.java:1127)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.resolveDataSchemaNodes(BindingGeneratorImpl.java:1056)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.containerToGenType(BindingGeneratorImpl.java:335)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.addSchemaNodeToBuilderAsMethod(BindingGeneratorImpl.java:1123)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.resolveDataSchemaNodes(BindingGeneratorImpl.java:1056)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.moduleToGenTypes(BindingGeneratorImpl.java:272)
    at org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl.generateTypes(BindingGeneratorImpl.java:241)
    at org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl.generateSources(CodeGeneratorImpl.java:61)
    at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.generateSourcesWithOneGenerator(YangToSourcesProcessor.java:306)
    at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.generateSources(YangToSourcesProcessor.java:245)
    at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.execute(YangToSourcesProcessor.java:86)
    at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesMojo.execute(YangToSourcesMojo.java:117)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle ...
(more)
edit retag flag offensive close merge delete

Comments

does this happen with Lithium SR1 (YT 0.7.1), too?

Robert Varga ( 2015-08-30 15:02:48 -0700 )edit

Hi, I have also same issue where I have been provided yang files and told yang build goes fine with confd. Bu I am not able to compile my yang files using Lithium SR1.

Aruna ( 2015-10-15 10:05:36 -0700 )edit