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