Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to remote dubug AEM OSGI bundle using eclipse?

Avatar

Former Community Member

Hi there,

Firstly starting CQ5 with:

java -Xmx512m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -jar cq-author-4502.jar

Then to start a remote debugging session from Eclipse, do the following:

  1. Open Eclipse.
  2. Choose Run > Debug Configurations.
  3. Right-click Remote Java Applications and select New.
  4. Select your CQ5 project under Project.
  5. Type in the port from the "address" configuration of the jvm parameter defined above. In the example, it is port 8000 (and the host name of the machine you are connecting to, most likely localhost)
  6. To start a debugging session, double-click your new configuration in the Debug Configurations screen after saving it.

However, i find the Breakpoint marked in eclipse never pause but the background print task running log that indicates program work finished.

Anyone know how to deal with it? Thanks a lot in advance.

(Reference source:http://helpx.adobe.com/experience-manager/kb/CQ5HowToSetupRemoteDebuggingWithEclipse.html)

Best regards,

Brian

1 Accepted Solution

Avatar

Correct answer by
Level 10

See this community artilce that talks about how to setup an AEM project using Eclipse for debugging:

https://helpx.adobe.com/experience-manager/using/creating-aem-project-using-eclipse.html

View solution in original post

11 Replies

Avatar

Employee

Hi Brian,

 

did you add the OSGi project (usually 'core' or 'bundle') to your debugging configuration? If you just add the 'apps' project (jsp, js, css, etc.) eclipse will not stop on a breakpoint.

 

Best regards

Matthias

Avatar

Former Community Member

hi schoger,

Yes, i did add the bundle to debugging configuration. Please see following screenshot:

[img]debug.png[/img]

But i notice log is printed, the breakpoint never pause! It's weird.

This is a sling servlet that integrated into OSGI bundle and deployed, as a result i suspect it not support debug servlet?

Avatar

Level 10

Thats surprising ! can you add couple of more debug points and check

Avatar

Employee

Hi Brian,

 

Servlet debugging is definitely possible! From your screenshot it looks like your debugger is not properly attached to the host process, after properly attaching, the breakpoint icon changes to a point with a little tick, see the screenshot I attached.

Please post a screenshot of your 'Servers' view open like in my screenshot, is the core bundle really added and synchronized?

[img]Debugging.jpg[/img]

 

Best Regards

Matthias

Avatar

Former Community Member

This class only one method doGet() to run, so i insert a breakpoint in the beginning. But never pause!

Avatar

Former Community Member

Hi Matthias,

Sorry i can't find the 'Servers' view to pen since i use the eclipse version 'Luna Release (4.4.0)'.

And i am sure core bundle added.

 

Best regards,

Brian

Avatar

Employee

Hi Brian,

 

no problem, I use Luna myself. You can find the 'Servers' view at 

Window->Show View->Other ...->Server->Servers

I'm not sure what the problem is with your installation, but something is wrong since Eclipse does not mark your breakpoint as valid (the missing tick on the breakpoint bullet).

 

Best regards

Matthias

Avatar

Former Community Member

Hi Matthias,

I just download Eclipse Luna SR1 to view server but, missing tick on the breakpoint bullet as well. It's confused.

I guess it not relevant to the Eclipse. Maybe there is other reason to this problem.

 

Best regards,

Brian

Avatar

Level 10

Hi Brian,

  Can you add a screenshot of your server configuration ?

Avatar

Former Community Member

Hi bsloki,

Sorry, i don't understand what your meaning of server configuration? And the code dont need to run any server platform. Just remote debug.

Please let me know what you want to know.

 

Best regards,

Brian

Avatar

Correct answer by
Level 10

See this community artilce that talks about how to setup an AEM project using Eclipse for debugging:

https://helpx.adobe.com/experience-manager/using/creating-aem-project-using-eclipse.html