keycloak 24 - debugging with visual studio code

First you need to install jdk 17 (if you're working with keycloak 24) or jdk 21  (for anything higher) and ensure you have maven installed.


java -version
git --version

Next clone keycloak repository using the following command: 


Build only the server. 

./mvnw -pl quarkus/deployment,quarkus/dist -am -DskipTests clean install

Once it is all build successfully. We will configure vscode.

Fire up vscode if you have not already done so and ensure you are in the keycloak repository. Ensure you have install java debugging extension. Then create launch.json that looks like this


{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "request": "attach",
            "name": "Attach by Process ID",
            "processId": "${command:PickJavaProcess}"
        }
    ]
}

From the command line, run the following command line. 

java -agentlib:jdwp=transport=dt_socket,server=y,address=5005 -jar quarkus/server/target/lib/
quarkus-run.jar start-dev --verbose



Ensure you have selected all the necessary breakpoints. 

And once, you have done that, select Run -> Debug in vscode. Then you will be prompted to pick java that you would like to debug. 

And if everything goes well, you will be able to see the followings.


Please ensure you do not have any application that binds to port 9000. As it is require by infinispan to run.












Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm