1

I tried to add the toaster example (with slight modifications) to a ODL distribution, but it failed to install from local maven repo, it said it was unable to execute the load command.

Steps to reproduce:

  1. Download & install the toaster sample.

    git clone -b stable/oxygen https://github.com/opendaylight/controller.git
    cd ./controller/opendaylight/md-sal/samples
    mvn clean install -DskipTests -Dcheckstyle.skip
    
  2. Download OpenDayLight Oxygen-SR3, then edit some configs:

  3. Append local maven repository in org.ops4j.pax.url.mvn.cfg

    org.ops4j.pax.url.mvn.defaultRepositories =
        [...],\
        file:${user.home}/.m2/repository@id=local-repo@snapshots
    
  4. Add toaster provider and consumer to the feature 63b7c6a7-e4db-407d-84a0-4fa24f1ae888

    <!-- I changed the default 1.7.4-SNAPSHOT version to 10.0.0-SNAPSHOT for comprehension -->
    <bundle>mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0.0-SNAPSHOT</bundle>
    <bundle>mvn:org.opendaylight.controller.samples/sample-toaster-consumer/10.0.0-SNAPSHOT</bundle>
    
  5. Run karaf to make sure the toaster is installed. Unfortunately they're nowhere to be found, and no warnings or errors produced in karaf.log

    ./bin/karaf
    feature:list | grep toaster
    
  6. So I tried to add via the CLI, but it returned an error:

    feature:repo-add mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0.0-SNAPSHOT
    

    Adding feature url mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0.0-SNAPSHOT

    [Fatal Error] :1:1: Content is not allowed in prolog.

    Error executing command: Unable to load mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0.0-SNAPSHOT : mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0.0-SNAPSHOT

    Full errors at http://pasted.co/f5ddf03f

Phuc
  • 159
  • 2
  • 7

2 Answers2

1

You should install the toaster feature:

feature:install odl-toaster

instead of just a couple of the individual toaster bundles. The feature encapsulates all the toaster bundles and dependent features.

Tom Pantelis
  • 1,349
  • 1
  • 7
  • 6
  • This is unrelated to the question. I'm trying to add an arbitrary feature to ODL, not install existed features. – Phuc Sep 21 '18 at 03:42
  • Huh? According to the steps you outlined, you are trying to build and install the existing toaster project in the controller project. In step 4 you tried just installing a couple of the toaster bundles. However there are other bundles and features that also need to be installed. Hence the reason for the toaster karaf feature which encapsulates everything. So you need to ensure the feature repo for the toaster is installed then install the odl-toaster feature. It's similar for any arbitrary feature. Make sense? – Tom Pantelis Sep 21 '18 at 11:51
0

If this question is not about the Toaster but in general, then this questio is a duplicate of OpenDaylight Oxygen Deploy app built from opendaylight-startup-archetype.

vorburger
  • 3,439
  • 32
  • 38
  • Or a duplicate of https://stackoverflow.com/questions/52341871/how-to-add-dlux-to-new-opendaylight-application (from the same poster). – Tom Pantelis Sep 23 '18 at 12:55