In a previous post we talk about how to setup Liferay development environment, we discussed steps  followed to install Eclipse, MySQL and Liferay.

As known in the development world that the debugging has a special importance for more productivity and rapidly detecting bugs and errors. for that reason I want to share in this post my experience on how to debug the Liferay code source. In this example I use liferay-portal-src-6.1.1-ce-ga2 you can download it from (link).

After downloading the zip file (liferay-portal-src-6.1.1-ce-ga2.*.zip) , extract it in the workspace in the following folder<LIFERAY_WORSPACE>/liferay-portal-src

1

Launch Eclipse, then import this code source as eclipse project as the following:

Select in menu File -> Import…

2

Select Existing Project into Workspace, then click Next, in the next step click Browse and select liferay-portal-src finally click Finnish.

3

For example if you want to debug the login action  in Liferay, go to the LoginAction Portlet and make a breakpoint in the  processAction method (the LoginAction Portlet is located in portal-imp/src/com/liferay/portlet/login/action/LoginAction).

Select the Servers view, Right-click on the server and select Debug

4

Launch a browser and go to localhost:8080. Click on Sign In, enter the login and password click on the login button and …

5

that’s all