wildfly-maven-plugin project in debug

113 views
Skip to first unread message

Adriano Aguiar

unread,
Mar 27, 2024, 7:06:38 AM3/27/24
to WildFly
I'm trying to run the wildfly-maven-plugin project in debug mode and I'm doing it according to the documentation, but without success.

<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>4.2.0.Final</version>
<configuration>
<debug>true</debug>
<debugPort>5005</debugPort>
<debugSuspend>true</debugSuspend>
<startupTimeout>120</startupTimeout>

James Perkins

unread,
Mar 27, 2024, 11:23:58 AM3/27/24
to WildFly
What goal are you attempting to run?

Adriano Aguiar

unread,
Mar 27, 2024, 12:47:00 PM3/27/24
to James Perkins, WildFly
I want to debug my project under development in the same way and when running mvn clean wildfly:dev I can't breakpoint and check

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/4241ac79-459d-4c53-90d9-177634a7365an%40googlegroups.com.


--
Adriano Aguiar
Desenvolvedor em Tecnologia da Informação
Desenvolvimento Web (PHP, Javascript, AJAX, Java EE, JSP);
Frameworks ( jQuery, JSF)
Arquiteto de Sistemas (UML, RUP)
Administrador e Programador em SGDB (Oracle PL/SQL, MySQL, SQL ANSI, PostgreSQL);
Servidores de Aplicações (Apache, Tomcat e Glassfish);

James Perkins

unread,
Mar 27, 2024, 2:05:43 PM3/27/24
to WildFly
The dev goal should work with those settings. I regularly use this feature. Are you running the command from the command like like mvn wildfly:dev? That is the only way I've ever ran it. 

Adriano Aguiar

unread,
Mar 27, 2024, 3:03:16 PM3/27/24
to James Perkins, WildFly
Yes, but when listening (Listening for transport dt_socket at address: 5005) there is a timeout

James Perkins

unread,
Mar 27, 2024, 3:11:55 PM3/27/24
to WildFly
Have you remotely connected to the debugger? By setting debugSuspend to true you're telling the process to pause until a debugger is connected. This happens before WildFly starts, so the startupTimeout would come into play if you haven't attached a remote debugger. If you just want remote debugging to be available, leave the debugSuspended set to false.

Adriano Aguiar

unread,
Mar 27, 2024, 3:55:43 PM3/27/24
to James Perkins, WildFly

I set debugSuspend to false and it worked, but debug doesn't work when putting one and breakpoint passes straight through

James Perkins

unread,
Mar 27, 2024, 4:06:10 PM3/27/24
to WildFly
Are you connecting with a remote debugger? What IDE are you using?

Adriano Aguiar

unread,
Mar 27, 2024, 4:46:36 PM3/27/24
to James Perkins, WildFly
I want to use local running my development machine and I'm using vscode

James Perkins

unread,
Mar 27, 2024, 5:27:08 PM3/27/24
to WildFly
When you run wildfly:dev in debug mode it requires a remote debugger to be attached. You can still connect from your local IDE, it just happens over a socket. There is no way I'm aware of to debug the process without a remote debugger. For VSCode have a look at https://code.visualstudio.com/docs/java/java-debugging#_attach

What happens is the wildfly-maven-plugin starts a new process with the effective JVM argument of -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005.

Adriano Aguiar

unread,
Mar 28, 2024, 9:50:01 AM3/28/24
to James Perkins, WildFly
I switched to intellij IDEA, but it didn't work out very well

James Perkins

unread,
Mar 28, 2024, 10:44:30 AM3/28/24
to WildFly
Can you explain a bit the steps you're doing? This works quite well for me and I use it regularly.

My typical workflow would be something like:
mvn clean wildfly:dev -Dwildfly.debug -Dwildfly.debug.port=5005

Once started in IDEA I use SHIFT+F9, on Linux that is the keyboard shortcut, then it attaches to WildFly and I'm able to debug. 

Adriano Aguiar

unread,
Mar 28, 2024, 10:58:38 AM3/28/24
to James Perkins, WildFly
How strange, I ran this same terminal command inside intellij, and it doesn't work

Adriano Aguiar

unread,
Mar 29, 2024, 4:46:21 PM3/29/24
to James Perkins, WildFly
See my settings as is and even running this command didn't work

image.png

James Perkins

unread,
Mar 29, 2024, 5:24:49 PM3/29/24
to WildFly
I'm not too sure what the issue could be. The configuration looks correct. You could try upgrading the plugin to 4.2.2.Final, but I don't recall any issues around the debug configuration.
Reply all
Reply to author
Forward
0 new messages