How to debug remotely WildFly

Do you want to learn how to remotely debug WildFly using IntelliJ, Visual Studio or Eclipse? in this tutorial we will show all the steps to get started in minutes!

Setting up WildFly

Debugging a remotely running Java application is an important skill for any developer. In order to activate remote debug in WildFly, you need to apply some Java options. These options are already included (but commented out) in the standalone.conf file. Here’s the line:

JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
  • JDWP is the communication protocol used to start the debug. The transport can be of type DT_SOCKET for Linux and DT_SHMEM for Windows machines.
  • Address is the client/server connection URL and by default it is 8787.
  • With suspend=y the Java-process will wait until the debugger connects, with suspend=n you will be also able to debug the application servers startup process.
  • The option server=y opens a socket and listens for incoming debugger requests. With server=n the debugged application will try to connect actively to a debugger and run therefore as a client.

That being said, uncomment the above line, then start WildFly as usual:

$ ./

Now let’s see how to debug using two different IDEs. IntelliJ and Eclipse.

Remote debug WildFly using IntelliJ Idea

Start IntelliJ and import your Project. Then, let’s add a breakpoint in our application:

wildfly remote debug port remote debug intellij eclipse wildfly

Choose from the Menu Run –> Attach to Process:

wildfly remote debug port remote debug intellij eclipse wildfly

Then, test your application. For example:

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"key":"xyz","value":"xyz"}' \

You will see that the Debugger kicks in, in your IDE:

wildfly remote debug port remote debug intellij eclipse wildfly

Now you can evaluate variables and debug the execution path of your application.

Debug WildFly with Visual Studio

Debugging Java applications with Visual Studio Community Edition is a powerful way to identify and resolve issues in your code. Visual Studio provides a range of tools that can help you debug your Java applications, including support for breakpoints, call stacks, and watch windows.

Make sure that you have a Java extension available for debugging Java applications:

debug wildfly

Next, add the following configuration launch.json to allow debugging from Visual Studio

    "version": "0.2.0",
    "configurations": [     

            "type": "java",
            "name": "Remote Debug (Attach WildFly)",
            "request": "attach",
            "hostName": "localhost",
            "port": 8787

With that configuration in place, you will be able to attach to WildFly remote process by clicking on the following icon:

attach to remote debug

Remote debugging WildFly with Eclipse

To enable debugging in your Eclipse IDE, it is generally sufficient to select from the Menu: Run | Debug As | Remote Java application.

eclipse remote debug

Otherwise, you can create a new Debug Configuration with a target Host and Port:

wildfly remote debug

More in detail, Eclipse won’t be able to attach automatically to the JVM with suspend=y. You will need to create a debug configuration with all connection properties to be able to attach early in the beginning to the JVM.

Pro tip: When running in debug mode, you can select he tab “Debug Shell“:

eclipse debug remote wildfly

From this Tab, you can directly type any expression and choose the “J” icon which displays the results of the expression. You can also add the expression to the watch list or execute Java code from the Shell.

You may want to check this tutorial to learn how to install the JBoss Tools plugin for Eclipse: Configuring Eclipse to use WildFly