Skip to content

Instantly share code, notes, and snippets.

@aelkz
Last active March 23, 2019 01:27
Show Gist options
  • Save aelkz/ad3b0eb5ace6d48f2ddb76b752fcd044 to your computer and use it in GitHub Desktop.
Save aelkz/ad3b0eb5ace6d48f2ddb76b752fcd044 to your computer and use it in GitHub Desktop.
intellij remote debugging (working with 183-5912.21)

REMOTE DEBUGGING USING INTELLIJ IDEA

1. Start your application server:

`./standalone.sh --debug``

You'll see something like the following output:

  JAVA_OPTS:  -server -verbose:gc -Xloggc:"/usr/local/devtools/rh-sso-7.2/standalone/log/gc.log" -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n

It will open the Java Debug Wire Protocol (jdwp) at port 8787/TCP.

2. Set your application breakpoints.

For this demonstration I'll be using the Red Hat Single Sign-On 7.3.0 as application server and the keycloak-services project from the source-code provided by Red Hat.

3. Configure IntelliJ IDEA debug configurations

Open the Run > Edit Configurations.. menu

Screen Shot 2019-03-19 at 3 25 26 PM

Set your application server parameters or add a new one if you don't have it installed yet.

Screen Shot 2019-03-19 at 3 26 32 PM

Go to the Startup/Connection tab and select Debug option. Set the Port to 8787 that is the same that was provided by application server startup (jdwp).

Screen Shot 2019-03-19 at 3 26 56 PM

That's all! now, you just need to open the application in your browser or dispatch a REST api call for example to trigger your breakpoints.

Screen Shot 2019-03-13 at 5 51 53 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment