Forums

Home » Liferay IDE » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jerome Jacobsen
Debug Liferay Portal 6.0.6 in Eclipse
September 12, 2011 12:42 PM
Answer

Jerome Jacobsen

Rank: New Member

Posts: 10

Join Date: May 14, 2007

Recent Posts

I would like to run Liferay Tomcat from Eclipse in debug mode and be able to set breakpoints in the Liferay classes as well as any classes I write.

Are there instructions for this setup somewhere? I was surprised that the Liferay Developer's Guide doesn't seem to have this.

I assume I need the liferay-portal-src-6.0.6-20110225.zip unzipped somewhere and my Eclipse workspace somehow configured to use it. Is that right? If so, how do I go about doing this?

Do I also need to setup a Portal SDK project in Eclipse that points to the Portal-SDK source code (e.g. from liferay-plugins-sdk-6.0.6-20110225.zip)?

Note that I have successfully installed the Liferay IDE and can run Liferay with no errors from the IDE. My next hurdle is how to set breakpoints in Liferay source code from the IDE.

Thanks in advance.

Jerome
Gregory Amerson
RE: Debug Liferay Portal 6.0.6 in Eclipse
September 12, 2011 11:11 PM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Master

Posts: 935

Join Date: February 16, 2010

Recent Posts

So once you have unzipped the source code, in your plugin project, right click the Liferay 6.0.6 runtime node in the package explorer. Then you want to edit the source attachment location for the portal-service.jar and point it to the liferay portal source/portal-service/ folder. You can do the same for other jars that you encounter when debugging, like portal-impl. Then you should be able to set breakpoints, etc.
Jerome Jacobsen
RE: Debug Liferay Portal 6.0.6 in Eclipse
September 13, 2011 5:17 AM
Answer

Jerome Jacobsen

Rank: New Member

Posts: 10

Join Date: May 14, 2007

Recent Posts

Thanks Gregory.

My portal source is extracted to C:/liferay/liferay-portal-6.0.6/source.

From Eclipse I created a Ext Plugin project called "TestExtPlugin" via File > New > Liferay Project. Now beneath "TestExtPlugin" is a node called "Liferay 6.0 CE (Tomcat 6) [Liferay v6.0 CE (Tomcat 6)]". I assume this is the one you refer to as the "Liferay 6.0.6 runtime node". And beneath that node I did find portal-service.jar and set it's "Java Source Attachment" Location path to C:/liferay/liferay-portal-6.0.6/source/portal-service/src.

However the node containing portal-impl.jar is under a different node called "Liferay Ext Plugin API". I assume that is the one I want to point to C:/liferay/liferay-portal-6.0.6/source/portal-impl/src. Also under "Liferay Ext Plugin API" I found util-java.jar which I pointed to its source in the same way.

How do I setup so that I can debug Liferay JSP files?

Jerome
Gregory Amerson
RE: Debug Liferay Portal 6.0.6 in Eclipse
September 14, 2011 3:10 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Master

Posts: 935

Join Date: February 16, 2010

Recent Posts

You are correct, the portal-impl.jar is under the API node. For debugging liferay JSPs that will require building Liferay portal from source, which is really out of scope of the IDE support . However, it is very possible to build the portal from source and then launch tomcat from it. However, I don't know exactly where to go to point to a "how-to" document on how to do that. I hope to have the IDE help with this in the future.
Jerome Jacobsen
RE: Debug Liferay Portal 6.0.6 in Eclipse
September 15, 2011 5:53 AM
Answer

Jerome Jacobsen

Rank: New Member

Posts: 10

Join Date: May 14, 2007

Recent Posts

Thank you for the clarification.
Jack Bakker
RE: Debug Liferay Portal 6.0.6 in Eclipse
July 23, 2012 4:51 PM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 641

Join Date: January 3, 2010

Recent Posts

What I did was:

put liferay-portal-src-6.0.6 folder in workspace

File : Import : General : Existing Projects into Workspace

for 'Select root directory', select the liferay-portal-src-6.0.6 folder

then go to Run : Debug Configurations : Source : Add : Java Project

select the liferay-portal-src-6.0.6 project

happily set breakpoints in the liferay source