Wowza Remote/Local Debugging with IntelliJ IDEA

When moving from eclipse to intellij one of the things I missed most was the ability to debug wowza applications from within the IDE. Luckily there is a way to get IntelliJ to accomplish this same thing.

I'm basing this off of Wowza Streaming Engine 4.0.3 and IntelliJ IDEA 13.1.2. Wowza running on Ubuntu 12.04 and IntelliJ on my Mac (OSX 10.9.2)

This will require a change to a wowza config and adding a new run option inside of IntelliJ for a debug session. Let's walk through this.

  1. We need to add a few options to the wowza JRE startup options. Open the Tune.xml file found in /usr/local/WowzaStreamingEngine/conf.

    You could separate these options into two different entries.. but for the sake of keeping all debug in one entry this needs to be added to the <VMOptions> node.

    <VMOption>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</VMOption>

    Save and restart wowza.

  2. Inside of IntelliJ there is a run/debug configuration panel. You can get to this two different ways. In the top menu "Run > Edit Configurations" or you can click on the run/debug dropdown near the top right section of the ide and select "Edit Configurations".

    You will need to add a new "Remote" configuration by clicking the plus sign above the left column and selecting "Remote". You can leave all the pre-filled options and you'll only need to change the "Host" entry and the search source module classpath. The host entry will be the address to your wowza server. The source module class path needs to be the source directory for the wowza project you want to debug. It is very helpful to give the configuration a name as that will show in the run/debug dropdown in the top control bar in IntelliJ. Click "Ok" to close the configuration editor.

  3. With wowza running select from the run/debug dropdown the configuration you previously configured. Then next to the dropdown on the right click the "debug" icon to run the debugger. This will connect to wowza and wait for any errors or breakpoints to fire. If it determines something has happened then it will halt execution and you will have a full stack to click through for variable inspection and code step through.

I hope this helps speed people along the path to Wowza application development and IntelliJ.

Happy coding!