RE: Liferay source code mismatch when debugging

thumbnail
Fernando Fernandez, modified 7 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts

Hi all,

 

I'm trying to debug with Liferay  CE 7.0.6 source code in a newly created  Liferay Workspace. I'm using a downloaded bundle. All this created with Eclipse Photon (4.8.0) + Liferay IDE3.4.

The problem is that when I'm stepping through a Liferay class (UserNotificationDefinition, in this case), the source code lines are misaligned. I'm not sure this is because the source code is not up to date or some Eclipse quirck .

Any ideas?

TIA

Fernando

thumbnail
Olaf Kock, modified 7 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Fernando Fernandez:

I'm trying to debug with Liferay  CE 7.0.6 source code in a newly created  Liferay Workspace. I'm using a downloaded bundle. All this created with Eclipse Photon (4.8.0) + Liferay IDE3.4.

You're saying "CE 7.0.6 source code" and "a downloaded bundle". Sounds legit to expect a mismatch, unless you are sure that "a downloaded bundle" indeed is 7.0.6... Are you?
thumbnail
Fernando Fernandez, modified 7 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts
Olaf Kock:
You're saying "CE 7.0.6 source code" and "a downloaded bundle". Sounds legit to expect a mismatch, unless you are sure that "a downloaded bundle" indeed is 7.0.6... Are you?

I think so.

I'm using an optional feature of the IDE that automatically downloads a liferay+tomcat bundle when you create a Liferay Workspace Project. When I am in debug mode I can look at Liferay's classes code without having downloaded the liferay src package.  Eclipse shows the code as coming from a .class file. 

Fernando 
 

thumbnail
Olaf Kock, modified 7 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Fernando Fernandez:

I'm using an optional feature of the IDE that automatically downloads a liferay+tomcat bundle when you create a Liferay Workspace Project. When I am in debug mode I can look at Liferay's classes code without having downloaded the liferay src package.  Eclipse shows the code as coming from a .class file.

The "Hello World" portlet (with the mountains picture in the classic theme) should give away the exact version that was downloaded automatically and that you're running. I guess that this is the cause of your mismatch.
 
thumbnail
Fernando Fernandez, modified 7 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts

It's "Welcome to Liferay Community Edition Portal 7.0.6 GA7 (Wilberforce / Build 7006 / April 17, 2018)" . There seems to be no mismatch here.

Anyway, if there is really a mismatch, it's inside the downloaded bundle, since I have no other sources on the workspace. 

There's always the possibility of this being a Eclipse problem and the source code just being shown misaligned.

 

I'll try to compare the shown code with a downloaded src archive or with the sources from github...

 

Thanks

 

Fernando

thumbnail
Fernando Fernandez, modified 7 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts

Apparently, the problem is that I had several versions of the jar file in the gradle cache. So, Eclipse was showing me the wrong one, probably because it doesn't know witch one I was  using.  This happened because I have many projects in the workspace and many were not using the same dependency version.

Since I'm using a "liferay.workspace.target.platform.version" in gradle.properties, I removed the version number from the dependencies in the several build.gradle files and it seems to work.

 

Fernando