Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

George Adam's profile - activity

2016-09-06 11:30:23 -0700 received badge  Notable Question (source)
2016-09-06 11:30:23 -0700 received badge  Famous Question (source)
2016-07-11 12:33:04 -0700 received badge  Organizer (source)
2016-07-11 12:29:49 -0700 asked a question Troubleshooting a ClassNotFoundException for yangtools CompatUtils

I am trying to build (mvn clean install) a simple ODL project skeleton (based off of the startup project archetype). Unfortunately, I’m running into some strange behavior. I can add typedef blocks to my yang file, but when I try to add a simple container block to the yang file the build fails with a ClassNotFoundException for the yangtools CompatUtils class. Here’s a condensed stack trace.


[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.912 s
[INFO] Finished at: 2016-07-11T12:25:10-06:00
[INFO] Final Memory: 41M/458M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.opendaylight.yangtools:yang-maven-plugin:0.7.5-SNAPSHOT:generate-sources (binding) on project eman-api: Execution binding of goal org.opendaylight.yangtools:yang-maven-plugin:0.7.5-SNAPSHOT:generate-sources failed: A required class was missing while executing org.opendaylight.yangtools:yang-maven-plugin:0.7.5-SNAPSHOT:generate-sources: org/opendaylight/yangtools/yang/model/util/type/CompatUtils
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.opendaylight.yangtools:yang-maven-plugin:0.7.5-SNAPSHOT
.
.
.
[ERROR] urls[50] = file:/Users/gadam001c/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>org.opendaylight.eman:eman-api:0.1.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.opendaylight.yangtools.yang.model.util.type.CompatUtils
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.opendaylight.yangtools:yang-maven-plugin:0.7.5-SNAPSHOT:generate-sources (binding) on project eman-api: Execution binding of goal org.opendaylight.yangtools:yang-maven-plugin:0.7.5-SNAPSHOT:generate-sources failed: A required class was missing while executing org.opendaylight.yangtools:yang-maven-plugin:0.7.5-SNAPSHOT:generate-sources: org/opendaylight/yangtools/yang/model/util/type/CompatUtils

Can anyone shed some light on what’s happening here, and how to fix it? I have tried the simple stuff like removing "org/opendaylight/yangtools" from my local .m2 repository and running the build again, but the error persists.

Any help is greatly appreciated.

EDIT 1

I have not been able to fix the error mentioned above, but I was able to work around it. I rebuilt my project from scratch using the ODL maven opendaylight-startup-archetype. After that I was able to add and build yang containers and lists as expected.

2016-07-07 09:21:14 -0700 received badge  Editor (source)
2016-07-07 09:06:36 -0700 received badge  Popular Question (source)
2016-07-07 06:27:09 -0700 received badge  Scholar (source)
2016-06-30 11:46:23 -0700 asked a question Determining pom.xml dependencies for Yang imports

I'm trying to create a yang file that will import items from the "ietf-yang-types" module.

 import ietf-yang-types         { prefix "yang"; revision-date "2010-09-24";} 

I have included a dependency in my main project pom.xml,

<dependency>
  <groupId>org.opendaylight.yangtools.model</groupId>
  <artifactId>ietf-yang-types</artifactId>
  <version>2010.09.24.4-SNAPSHOT</version>
</dependency>

but when I try to build the project (with "mvn clean install") it still fails with the following error message.

[ERROR] Error 1: Imported module [ModuleIdentifierImpl{name='ietf-yang-types', namespace=null, revision=2010-09-24}] was not found. [at META-INF/yang/odl-eman-entity.yang:14:2]

What am I missing? How do I add the correct pom dependency so that maven will know where to find the specified yang import? In addition, is there a good central location to find the required dependency information for common ODL yang imports?

Thanks in advance for helping an ODL neophyte.

EDIT 1

The issue was resolved by placing the correct maven dependency into the correct pom.xml file. The maven archetype for an ODL project adds the yang-to-sources dependencies to the <project_name>/api/pom.xml file. It was that yang-to-sources generation that was failing. Placing the dependency entry in that file fixed the problem.

EDIT 2

Aparently all of the yang-model projects have been migrated from Yangtools to MD-SAL. The more up-to-date location of the ietf-yang-types model is:

<dependency>
  <groupId>org.opendaylight.mdsal.model</groupId>
  <artifactId>ietf-yang-types</artifactId>
  <version>2010.09.24.4-SNAPSHOT</version>
</dependency>