Importing OpenDaylight Into Eclipse

Importing OpenDaylight Into Eclipse

Openflow Programming Header Sm

Importing OpenDaylight Into Eclipse

This is a quick video for importing OpenDaylight into Eclipse for development. You need to build OpenDaylight with Maven prior to importing it into Eclipse. Once you build ODL from the CLI, you can either run it from there for learning OpenFlow or getting to know the OpenDaylight controller or go on to importing the controller into Eclipse. For those new to Eclipse, it is a free and open source (FOSS) integrated development environment (IDE) that supports Windows, Mac and Linux. Once imported and built in Eclipse, you can run the project from within the IDE for test/dev.


Here is a recording from ONS 2013. This was a Q&A session with the technical steering committee (TSC). The recording is pretty grainy since it was just a pocket recorder. You can’t hear David Meyer very well in the audio but you can hear the panel well enough. The ONS does a nice job of getting a lot of the content on their YouTube channel. I will replace this with a link to that once it posts.OpenDaylight TSC Q&A from ONS 2013


Video: Importing OpenDaylight Into Eclipse

I will keep this page or some pointer to a page updated as the project matures. Make sure you use JDK7 and not JDK6. See this thread on the ODL Listserv. The audio is very low, I will remix it in the next day or two and upload it.


OpenDaylight Mac OSX CLI Build

If you don’t build ODL from the CLI prior to importing it into Eclipse you will end up with thousands of errors. This sort of thing seems easier to follow along a video rather then following 30 steps of instructions. If you have never used Eclipse, keep an eye in the bottom right of the main window for its progress bar. It is always best to leave Eclipse alone while it is downloading dependences or project code.


If you want to just run the controller from the CLI the following will start it up. First you need to set the $JAVA_HOME ENV variable and then run the shell script to start the controller.


Then point your browser at IP addr on port 8080 or use the REST API (API subject to change) along with everything else since this is in its infancy.


Building OpenDaylight Into Eclipse

  • It is probably best to use Eclipse IDE for Java EE Developers – Eclipse IDE for Java EE Developers
  • I used this Wiki entry for the m2e (Maven Integration for Eclipse) dependencies I was getting tripped up on: OpenDaylight – Eclipse CLI Setup
  • Make sure you use m2e v1.2 rather then v1.3. If you are using an existing Eclipse install it is probably running the latest. Just uninstall it under Eclipse-> About Eclipse -> Installation Details and remove the two m2e dependencies. Then go to help -> install new software and plug in the URI http://download.eclipse.org/technology/m2e/releases
  • You may get 40-50 errors or so after you import ODL as an existing Maven project. That is a missing dependency, Tycho. Eclipse will downloaded Tycho automatically, just click “auto select” as shown in the video.
  • Prior to being able to run the controller within Eclipse you need to run the configuration /distribution.opendaylight/opendaylight-assembleit.launch with “run-as” opendaylight-assembleit.launch to finish the build. There is probably be a better way, but this was where I ended up after poking around for a while to get it working.
  • The pom.xml (Project Object Model) instructs maven to create a jar file and basically contains everything that is significant about the project. The pom.xml file is located in distribution.opendaylight/pom.xml.

Building OpenDaylight In Linux

If you are using Linux, the following will cover the CLI Maven build.

OpenDaylight Maven Build Error
If you receive any OutOfMemory resembling the following:
If your Maven build fails with a ” OutOfMemory: PermGen Space ” Re-run Maven using the -X switch to enable full debug logging. This is due to a memory leak somewhere in the Maven build and is being tracked as a bug.

In the meantime run the following instead of “mvn clean install” and it will skip the integration tests that seem to be the source of the GC leak. Also increase memory allocation for Maven.


You will need at least around 1.5GB of memory or you may run out of memory during the Maven build. The error will look like this:




I started hacking on a module, by just copying an existing module and adding it to pom.xml file. I am more familiar with Floodlight then Beacon.


I did a screencast of installing OpenDaylight and installing some flowmods with Mininet and the link to the ODL Eclipse install Wiki entry:

Good stuff. This is a unique time to say the least. Its probably one of those 15-20 year disruption cycles, last one was the Internet in the late 90’s. Jump in and shape its direction.


Thanks for stopping by.

About the Author

Brent SalisburyI have over 20 years of experience wearing various hats from, network engineer, architect, ops and software engineer. More at Brent's LinkedInView all posts by Brent Salisbury →

  1. AnnaAnna04-19-2013


    Hi Brent,

    Thanks a ton for the video. It was very helpful. Could you access controller CLI commands mentioned at https://wiki.opendaylight.org/view/OpenDaylight_Command-Line_Interface_(CLI):
    Main

    Thanks again!

  2. Brent SalisburyBrent Salisbury04-22-2013


    Hi Anna, glad it helped! The CLI is just starting to get fleshed out.
    You can track the status on the controller-dev lsv:
    https://lists.opendaylight.org/pipermail/controller-dev/2013-April/000198.html

  3. Vinay PaiVinay Pai05-30-2013


    Hi Brent,

    Thank you so much for the video! It was really helpful! I just had a couple of small questions since I am a newbie to SDN. The Open Daylight web page has some links related to sample Applications. but it does not mention anywhere as to how to run these Applications. It would be really great if you could direct me to a link which shows that or just give me a hint regarding the same.

    Regards,

    Vinay Pai B.H.

  4. Brent SalisburyBrent Salisbury06-03-2013


    Hi Vinay!

    Here are some sample apps https://wiki.opendaylight.org/view/OpenDaylight_Controller:Sample_Applications

    I think the quickest way to hack together a new bundle would be to copy one of the sample apps and paste it back into the project.

    Modify the pom.xml from the old bundle to the new one. Do the same in the distribution pom.xml to load the new module in controller/opendaylight/distribution/opendaylight/pom.xml

    Modify the the Activator.java file.

    That will get the copied bundle into the project.

    Cheers!
    -Brent

  5. ElsieElsie11-19-2013


    Hi Brent,

    I met a problem after typing “mvn clean install -X”. It shows some information like this:

    [INFO] sal-broker-impl …………………………….. SUCCESS [2.931s]
    [INFO] sal-binding-api …………………………….. SUCCESS [0.347s]
    [INFO] yang-jmx-generator ………………………….. SUCCESS [8.490s]
    [INFO] yang-jmx-generator-plugin ……………………. FAILURE [11.087s]
    [INFO] sal-binding-config ………………………….. SKIPPED
    [INFO] model-parent ……………………………….. SKIPPED
    [INFO] model-flow-base …………………………….. SKIPPED

    It stops at yang-jmx-generator-plugin and skip all the projects below. Would you please give some advice how to fix it?

  6. FabioFabio11-20-2013


    Hi Brent,

    I’m trying to debug in eclipse, the more I receive the following error log:

    !SESSION Wed Nov 20 08:32:05 PST 2013 ——————————————
    !ENTRY org.eclipse.equinox.launcher 4 0 2013-11-20 08:32:06.003
    !MESSAGE Exception launching the Eclipse Platform:
    !STACK
    java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:626)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

    do you know the reason for the error?

    My intention was to find out which class need to insert the breakpoint and capture the command entered in the command line interface and change the Mininet runtime command
    h1 ping h2 for h1 ping h3

    Regards,

    Fabio

  7. yrenyren01-29-2014


    Hello Brent, I was learning to build the code by following the steps in your blog and youyube video. Everything works fine until “mvn clean install”.

    My setup is Vbox+Ubuntu1204+openJDK7+Maven3. I have tried “mvn install”, “mvn clean install -U” and “mvn3 clean install” and the same errors I got are:

    [ERROR] Failed to execute goal on project distribution.opendaylight: Could not resolve dependencies for project org.opendaylight.controller:distribution.opendaylight:pom:0.1.2-SNAPSHOT: Failed to collect dependencies at org.opendaylight.controller:sal-common:jar:1.1-SNAPSHOT: Failed to read artifact descriptor for org.opendaylight.controller:sal-common:jar:1.1-SNAPSHOT: Could not find artifact org.opendaylight.controller:sal-parent:pom:1.1-SNAPSHOT in opendaylight-snapshot (http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/) -> [Help 1]

    If you happen to see the same issue, would you please let me know the solution via Email? I have asked this in the freenode IRC#opendaylight and mailing list but no reply so far.
    Thank you,
    Yuqing

  8. Arun.Arun.03-31-2014


    Hi Brent, I’m getting the following error while running mvn clean install.

    [INFO] ————————————————————————
    [INFO] BUILD FAILURE
    [INFO] ————————————————————————
    [INFO] Total time: 7:18.544s
    [INFO] Finished at: Mon Mar 31 14:02:11 PDT 2014
    [INFO] Final Memory: 25M/59M
    [INFO] ————————————————————————
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.10:check (default) on project distribution.opendaylight: Unable to create output stream: /home/adisarun/controller/opendaylight/distribution/opendaylight/target/checkstyle-result.xml: /home/adisarun/controller/opendaylight/distribution/opendaylight/target/checkstyle-result.xml (No such file or directory) -> [Help 1]

    Could not debug as I am new to Maven & ODL.

    I would appreciate your help