Foros de discusión

Debug Liferay Portal 6.0.6 in Eclipse

Jerome Jacobsen, modificado hace 12 años.

Debug Liferay Portal 6.0.6 in Eclipse

New Member Mensajes: 10 Fecha de incorporación: 14/05/07 Mensajes recientes
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
thumbnail
Gregory Amerson, modificado hace 12 años.

RE: Debug Liferay Portal 6.0.6 in Eclipse

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes
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, modificado hace 12 años.

RE: Debug Liferay Portal 6.0.6 in Eclipse

New Member Mensajes: 10 Fecha de incorporación: 14/05/07 Mensajes recientes
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
thumbnail
Gregory Amerson, modificado hace 12 años.

RE: Debug Liferay Portal 6.0.6 in Eclipse

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes
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, modificado hace 12 años.

RE: Debug Liferay Portal 6.0.6 in Eclipse

New Member Mensajes: 10 Fecha de incorporación: 14/05/07 Mensajes recientes
Thank you for the clarification.
thumbnail
Jack Bakker, modificado hace 11 años.

RE: Debug Liferay Portal 6.0.6 in Eclipse

Liferay Master Mensajes: 978 Fecha de incorporación: 3/01/10 Mensajes recientes
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