2

I recently created a basic HelloWorld ODL module as stepped out here, and I am able to make it work. I.e., I can run restful POST commands against it and get my "hello" reply.

{
    "output": {
        "greeting": "Hello Andrew"
    }
}

Now, what I'd like to do is install this module into the actual ODL as compiled from the integration distro repos.

The steps I follow are:

  1. Successfully create the HelloWorld ODL module and run karaf from within the HelloWorld karaf subfolder

  2. Knowing that mvn install against the Hello project will publish this module into my local .m2/repository/org/opendaylight/hello repo, I move on to the actual ODL integration/distro

  3. in the features/repos/index/pom.xml file in ODL, I add the following profile:

    <profile>
        <id>hello</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <dependencies>
          <dependency>
              <groupId>org.opendaylight.hello</groupId>
              <artifactId>features-hello</artifactId>
              <classifier>features</classifier>
              <version>1.0-SNAPSHOT</version>
              <type>xml</type>
          </dependency>
        </dependencies>
    </profile>
    
  4. Then I successfully run mvn install on ODL and it does not error on that profile. (Note: if I typo anything in that profile section, the mvn install will fail)

  • I am doing everything to ODL v0.11.0 and Sodium 1.2.0 in my application, so I am sure the versions are correct.

All is said and done, the ODL karaf does fire up and I am able to run rest commands against it... however the same POST command that worked purely against the HelloWorld module does not work in the integrated distro ODL. Instead I get this error message back:

{
    "errors": {
        "error": [
            {
                "error-type": "protocol",
                "error-tag": "unknown-element",
                "error-message": "The module named 'hello' does not exist."
            }
        ]
    }
}

In some ways, this question is a bit of an extension to my previous one here: Source code of the full OpenDaylight Integration Distribution Bundle. So just linking them together here.

Update: I created an inverse to this question here: Procedure to add features to OpenDaylight application.

Note:

  • In the feature:list section, I do not see Hello listed
E.S.
  • 2,733
  • 6
  • 36
  • 71

1 Answers1

-1

ODL Integration distribution does not install any karaf feature by default, so once you start the distribution, check whether your project feature is installed (e.g. feature:list -i). If it is not, just install it (e.g. feature:install ).

ecelgp
  • 107
  • 3
  • Unfortunately, the "hello" sample feature is not listed in feature:list... – E.S. Jul 27 '20 at 16:52
  • 1
    I'm not sure what it is, but there is probably something small missing that is not bringing your feature in when you build integration/distribution. Try comparing to another project to see if you can figure it out. maybe checkout the aaa project and compare to one of it's features like odl-aaa-cert. BTW, if you find there is some basic step missing in the docs, let us know (email) or even better, you can update the docs yourself and contribute to opendaylight :) – jamo Jul 27 '20 at 23:20
  • @jamo I assume you mean copy the structure of this repo https://github.com/opendaylight/aaa/tree/master/aaa-cert and modify it to fit our own module? – E.S. Jul 28 '20 at 00:13
  • @jamo - put another way, "How do I create a new feature and ensure it is properly listed in the feature:list section of karaf" - I am not able to find the documentation on doing that. – E.S. Jul 28 '20 at 20:39
  • no, what I mean is to clone the AAA repo then poke around it's configs (e.g., pom.xml files) for how the odl-aaa-cert feature is defined and setup. I know that feature is available in feature:list of a full distribution. You might find something that you missed in your hello project. – jamo Jul 29 '20 at 21:16