Debugging OpenDaylight Controller In Eclipse

Once you have installed OpenDaylight successfully and imported the code into eclipse you should get a clean workspace without any errors.

If you are facing any errors & you think we can help, please post below & I will see if I can.

So now you want to run the controller from eclipse & make changes & debug it? Let’s do that with a example change.

Goal (Cooked up): Change OpenDaylight Title to "SDN{Geeks}".

So for this, we will need to do the following:

1. Change the web component of OpenDaylight for title in eclipse.

Navigate to the web component of OpenDaylight & change/save main.jsp.

Main

2. Build web component (independently) via eclipse.

Right click on the web component & say “Run Configurations”. Create a maven job for the web project like below. Click Apply & Run.

Maven_Web

3. Build controller main component (independently, building the whole thing is somehow not smart) via eclipse.

Distribution project within OpenDaylight is the main project which holds the configurations for the controller startup etc. Once above step is done, we want that jar to be included for the run & hence need to build the master component.

Right click on the distribution component & say “Run Configurations”. Create a maven job for the distribution project like below. Click Apply & Run.

Dist_Component

Maven_Dist

4. Run the controller in Run/Debug mode from eclipse.

Now to run the controller from eclipse, navigate to below file. Right click and say “Run As” or “Debug As” “OpenDaylight Application”.

<Workspace> controller/opendaylight/distribution/opendaylight/opendaylight-application.launch

This will start the OpenDaylight controller in run/debug mode with your changes applied.

Launch

 

Goal Complete

You can repeat this for any component and it should be straight forward. If you find any issues with this, let me know below.

Advertisements

Installing OpenDaylight On CentOS

Please refer to Blinken’s blog for writing in detail about How to install OpenDaylight Controller on CentOS.

I suggest you follow his blog for this & come back here when you are at the step which says,

Configuring the Java variables

Belkins_Blog

As per the OpenDaylight Documentation:

Prerequisite: JVM 1.7+ (JAVA_HOME should be set to environment)

Now this is important as above blog uses java 1.6 with which controller might not fireup. Here are the steps to find out what version of java you are running & now to install 1.7

Find out all the versions available: yum search java | grep 'java-'

In the above list you should have java-1.7.0-openjdk.x86_64 (or development). Once you find that, use below command to install the right dev kit.

yum install java-1.7.0-openjdk.x86_64

You can opt out to remove 1.6 via yum itself if you don’t need it. (Like us). This should do it, you can follow the rest of instructions on Blinken’s blog.

Other problem that you might face while clean/install of controller is OutOfMemory.

Refer to the OpenDaylight Troubleshooting to increase your PermGen space for maven.

With these two additional steps, we were able to get controller up & running.

Accountability Vs Responsibility

Sometime back my manager frequently used to say, “Saurabh this feature is your responsibility“. But lately I have started hearing, “you should take ownership for this feature and you will be accountable for its delivery”.

So, what’s the __ difference I thought to myself. Here is what I think it means. You are free to let me know, what you feel.

In English its not much better, if you check on line, quite often, the definitions are interchangeable.

Responsible means that you are involved, possibly performing a clearly defined task, and your performance could determine a successful outcome.

Accountable means that its up to you to ensure that there will be a successful outcome. Even though you might not actually be performing any of the tasks involved.

Let me explain with an example.

In football/soccer players are responsible, for the passing, tackling, attacking, defending and scoring of the goals that will determine who wins the game.

The manager is accountable for result. If the team loses he is the one who will need to explain why to his bosses, and will possibly suffer the consequences after a string of poor results.

Many people say that’s its unfair, as the manager doesn’t kick a single ball.

However, it is the manager who selected the players, trained the players, decided the tactics, provided the motivation and game plan, was able to make the changes to players and tactics as the match unfolds.

We can delegate responsibility for tasks, but we cannot or should not delegate accountability.