Expand my Community achievements bar.

Remote debugging AEMaaCS in docker

Avatar

Level 1

Hi,

 

I am trying to setup a local AEM instance with docker. So far I was able to setup a Author, Publish and dispatcher. But I only have issues with setting up the JVM remote debugging. I am able to connect the JVM debugger it is just not stopping at the breakpoints. This is the setup :

Dockerfile : 

FROM openjdk:11
WORKDIR /opt/aem
EXPOSE 4502
EXPOSE 5005
COPY author-p4502.jar /opt/aem/author-p4502.jar
COPY start.sh /opt/aem/start.sh
COPY install /opt/aem/install/
RUN chmod +x /opt/aem/start.sh
CMD ["/opt/aem/start.sh"]

Docker-compose.yml :

version: '3.8'
services:
aem-author:
build:
context: ./author
container_name: aem-author
ports:
- "4502:4502"
- "5005:5005"
environment:
- AEM_RUNMODE=author
- JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
volumes:
- ./author/crx-quickstart:/opt/aem/crx-quickstart

aem-publish:
build:
context: ./publish
container_name: aem-publish
ports:
- "4503:4503"
environment:
- AEM_RUNMODE=publish
volumes:
- ./publish/crx-quickstart:/opt/aem/crx-quickstart

aemaacs-dispatcher:
build:
context: ./adobe-dxp-dispatcher
container_name: aemaacs-dispatcher
ports:
- "80:80"

depends_on:
- aem-publish

volumes:
- ./adobe-dxp-dispatcher/src/conf.d:/etc/httpd/conf.d
- ./adobe-dxp-dispatcher/src/conf.dispatcher.d:/etc/httpd/conf.dispatcher.d

Start.sh :

#!/bin/bash
echo "Starting AEM in author mode and debug port 5033..."
export JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
java $JAVA_OPTS -jar /opt/aem/author-p4502.jar &
sleep 60
FLAG_FILE="/opt/aem/install/.package_installed"
if [ ! -f "$FLAG_FILE" ]; then
echo "Deploying content package for the first time..."
curl -u admin:admin -F file=@/opt/aem/install/content.zip -F force=true -F install=true http://localhost:4502/crx/packmgr/service.jsp
touch "$FLAG_FILE"
else
echo "Content package already installed, skipping deployment."
fi
tail -f /dev/null

If someone could help me out that would be great!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Level 9

HI  @diegov53610848 

Can you try to explicitly add -Xdebug to JAVA_OPTS ?

Avatar

Level 1

Thanks for the suggestion. But this didn't fix it unfortunately.

Avatar

Level 9

What if you change the CMD in your Dockerfile with smth like this:

 

CMD ["/opt/aem/start.sh", "-p", "4502", "-p", "5005"]

 

I am thinking that you might have an issue with the ports mapping. I know you have specified that already in the Docker-compose.yml file, but still worth trying.

 

Also, maybe you can get some inspiration from this documentation, about additional arguments you can use:
https://github.com/paulrohrbeck/aem-links/blob/master/docker.md#running-aem-650-publish-with-debuggi.... I am thinking of trying also the

 

-Dorg.apache.felix.http.host=0.0.0.0