This Blog will quickly explain how to setup debugging in a Liferay Devstudio(EE), which will be leading us through easy steps:
- get devstudio from liferay customer portal (http://www.liferay.com/group/customer/downloads/dev-studio/1.4)
- get the source code from liferay customer portal (http://www.liferay.com/group/customer/downloads/liferay-portal/6.0)
- installation of devstudio
- installation of liferay source code as a project in eclipse
- start debugging
So let us start:
First we download the archives from the liferay customer portal:
- Go to Liferay.com and login
- select Customer Portal, Select your Liferay Portal Version and get the Devstudio or just use the latest form here http://www.liferay.com/group/customer/downloads/dev-studio/1.4
- Make sure you download the correct version for your OS

Next we want to download the source code:
- Back on the Product Selection page we navigate to the liferay version we want to debug (6.0 SP2 with Devstudio 1.4, 6.0SP 1 with Devstudio 1.2)
- From the Box we choose the Liferay Source Code

Once we have the Devstudio we can run through the Wizard based Installation process, requiring us to deploy a valid license.
For the easy setup we can choose our workspace to be in the folder where we installed the Devstudio into, which is on my end: /Volumes/data/Liferay Developer Studio 1.4.0
Note that I am using a Mac, so my Workspace will be
/Volumes/data/Liferay Developer Studio 1.4.0
The source code of the portal ends up here
/Volumes/data/Liferay Developer Studio 1.4.0/portal-trunk
can also be
c:/workspaces//Liferay Developer Studio 1.4.0/portal-trunk
if you are using another OS
If you want to debug liferay services it is also advised to install a proper database, as explained here:
http://www.liferay.com/community/wiki/-/wiki/Main/Database+Configuration
Elsewhise you can proceed and liferay will use HSQL as a database.
Next Step is to setup the liferay source code as a project in Devstudio:
- Go to the Menu: File/Import or right click in the Project Explorer/Import

From General we choose Import Existing Project

Next we select the directory where we unzipped the source code into and click finish.

Ok we are ready to setup the debugger now, by clicking on the small bug in the Devstudio Toolbar and click on Debug Configurations.

Then in the next Dialoque we will configure the liferay project as a source folder for the liferay server 6.0 EE.
- Double click on Liferay v6.0 EE (Tomcat 6)
- Select the Source Tab from the right
- Click the add button
- Choose Java Project
- Select portal-trunk
- Click ok
- Leave the Dialoque and save

If we have setup everything correctly we should be able to debug now, lets open a Java File and set a break point to prove we actually can:
- Press Ctrl(Cmd) + Shift + R and open StartupAction.java (Package: com.liferay.portal.events)
- Set a breakpoint in line 65(Double Click on the left where the dot is on the screenshot)

- Start the Server in debug mode (Click on the small bug in the next menu)

- You can open the Debug Perspective right now or wait until Devstudio catches the Debug event and shows a dialoque which will lead you there

- The play button on the top will let the server proceed execution and the arrow buttons to the left will let you proceed step by step
Enjoy debugging Liferay EE


