Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay source code mismatch when debugging
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
Attachments:
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?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.
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
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.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.
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
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
Attachments: