April 3, 2020
Estimated Post Reading Time ~

Running and debugging CQ5 using CRXDE

The problem you want to debug your code on a CQ5 server using Breakpoints in CRXDE, but the Debug option is greyed out.

The SolutionChances are, you are not running CQ5 in debug mode. Here is a simple way to start your CQ5 instance in debug mode, and how to attach CRXDE to it.

Assuming a Windows machine and a local copy of CQ5 for the purposes of this tutorial, located at c:\cq5\author running on the default port 4502.

1. Ensure that all local instances of CQ5 are shut down.

2. Under windows. open up command from the start menu, navigate to the c:\cq5\author directory

3. copy and paste the following command:

java -debug -XX:MaxPermSize=256M -Xnoagent -Xmx1024M -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=30303 -jar cq5-author-4502.jar -nofork

4. IMPORTANT: It can take quite a while for the server to start in debug mode. Wait until your browser window opens up at the author's login screen before continuing.

5. Open up CRXDE. Search for it in your supplied CQ5 materials.

6. Enter http://localhost:4502 in the URL field, and admin/admin for the username and password.

7. Click on OK, and wait for CRXDE to load.

8. To test, we can navigate to a piece of code that you can break into.

A good place to test is to put a breakpoint on line 31 in /apps/geometrix/components/title/title.jsp

When you have put the breakpoint in, navigate to:
http://localhost:4502/cf#/content/geometrixx/en/products.html

You will now be able to step through your code.

No code complete in CRXDE
The Problem In CQ5.5 SP1, CRXDE does not have code complete, classes can't be found, the laptop is in serious risk of defenestration.

The Solution Go to Package Share in CQ5 admin on the author.

http://localhost:4502/crx/packageshare/

Log in if required with your adobe id.

Click on Download for:
1. Missing CRXDE-Libs
2. CRX Hotfix Pack

And install these packages.

Restart CQ5 and CRXDE, and hopefully, this will have resolved the issue.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.