Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Why isn't debugging easier? Where's the source code?

jkpanera
Level 5
Level 5

I am a very experienced Java developer who has been learning AEM for the last year. One of the things that makes me crazy is that it's so hard to debug.

In theory most of AEM is open source. In practice, it isn't.

Inevitably, I'm going to want to debug my application, but Adobe has gone out of its way to make that difficult. I can't just download a source jar with my IDE and set a break point (as was possible when using most other frameworks). When I do download a source jar Sling/Jackrabbit, whatever, inevitably, the source doesn't match.

Why doesn't Adobe choose release versions of the frameworks that it uses?

It's horribly frustrating. I understand that you  are selling so VPs not developers, but you aren't making friends by doing this.

I don't think I would recommend that anyone use AEM.

5 Replies
Andrew_Khoury
Employee
Employee

Hi jkpanera​,

You should be able to do debugging using remote debugging as documented here:

Debug an AEM app using eclipse

Remote debugging is available in all major Java IDE's.  Using remote debugging, you can debug your application's code.

In addition, the code for Apache Felix, Sling and Jackrabbit Oak is available on github: The Apache Software Foundation · GitHub​.

Jörg_Hoh
Employee
Employee

Can you give an example where the problem arises, that a sling or Jackrabbit bundle you downloaded does not match the code?

Also the AEM uber jar only references the API bundle versions, and does not specify the version number of the implementation bundles. This is by design. If you really want and need to debug into the implementation bundles you probably have specify them in your POM as well, just to pinpoint to the correct version.

And to be honest, I was not aware of the problem you describe. Either other developers solve it for themselves and never talk about it, or it's not a problem at all for them (and then I don't know why). Maybe others can elaborate a bit on this, because I don't debug into the live system.

Jörg

jkpanera
Level 5
Level 5

Here's an example:

 

I have this HTL:

 

<sly data-sly-use.model="com.panerabread.core.models.ui.forms.TextField"></sly>
<sly data-sly-test.isTextArea="${model.type == 'textArea'}"></sly>
<sly data-sly-test.id="${model.id}"></sly>
<div class="pds-field ${isTextArea ? 'pds-input-field pds-textarea-field' : 'pds-input-field'}">
<input data-sly-test="${!isTextArea}"
type="${model.type}"
id="${id}"
class="pds-input"
name="${model.name}"
placeholder="${model.placeHolder}"
autofocus/>
<textarea data-sly-test="${isTextArea}"
id="${id}"
placeholder="${model.placeHolder}"
class="pds-input pds-textarea pds-textarea-transparent"
name="${model.name}">
</textarea>
<label class="pds-label"
for="${id}">
${model.label}
</label>
<!--/* Hint section. */-->
<div data-sly-test="${model.hintText}" class="pds-field-hint">
<!--/* Error handling for the invalid text input. */-->
<p class="pds-field-hint-text">
<span> ${model.hintText} </span>
<!--/* TODO Handle validations */-->
<!--/* <span> ${model.preparedForInvalidCharactersError} </span> */-->
<sly data-sly-list.valiation="${model.validations}">
${valiation.constraint}
${valiation.message}
</sly>
</p>
</div>
</div>



I can stop in the debugger and see that the name field is as expected "name"

 

Screen Shot 2021-05-06 at 16.18.59.png

 

But this is the content that's generated:

 

It's this:

 

Screen Shot 2021-05-06 at 16.22.08.png

For some reason, it inserts the name of the content package rather than the name in the component.

 

Something in sling is changing it and I can't debug into the generated code.

 

Himanshu_Singhal
Community Advisor
Community Advisor

And, IntelliJ provides Remote debugging in a quite good way where you can set debug point in compiled classes as well without installing any source code compiler in IDE.

software_engineer
Level 2
Level 2

Hi @jkpanera, I read your question and the replies of the Adobe employees here. I see that none of the replies here is an accepted solution to your question, though it's an old question and I see that you are still active in this community. Did you find a solution? 

By the way, I have added a question regarding my problems here: Why the "uber-jar-6.5.5-sources.jar" does not contain the source code of all open source libraries a...