VOOZH about

URL: https://www.javacodegeeks.com/2018/04/run-and-debug-a-wildfly-swarm-application-from-netbeans.html

⇱ Run and Debug a WildFly Swarm application from NetBeans - Java Code Geeks


Java EE developers using NetBeans are used to be able to run and debug their thin-war applications in their application server of choice directly from NetBeans. When developing microservices packaged as ΓΌber-or hollow-jars, you expect the same effortless way of running and debugging. The good news is that you can. In this post, I show step-by-step how to run and debug the WildFly Swarm version of CloudEE Duke in NetBeans.

Run WildFly Swarm application

The easiest way of running CloudEE Duke in NetBeans is to edit the Run project action for the project. Right click on CloudEE Duke, select properties and Actions as shown below.

πŸ‘ Image

Configure the Execute Goals to  package wildfly-swarm:run, remove all the default properties and your’re all set. Run Project ( F6 ) will start the application using the WildFly Swarm Maven Plugin.

Debug WildFly Swarm Appliction

To enable debugging, you follow the same steps as described above, but in this case it is the Debug Project action you select.

πŸ‘ Image

Execute Goals is configured the same way as for Run, but in the Set Properties, you need to configure a debug port for WildFly Swarm. This is done by setting the  swarm.debug.port property, e.g. to 9000.

Debug Project  Ctrl-F5 will start the application in debug mode. Note that the execution will halt while waiting for the debugger to attach. See the screenshot below for how it will look in the log.

πŸ‘ Image

Select Debug->Attach Debugger from the menu in NetBeans. Change the value for Port to 9000 (or the value you chose in the previous step) and click OK.

πŸ‘ Image

To verify the setup, set a breakpoint at line 16 in the class  HelloWorldEndpoint.

πŸ‘ Image

Then navigate to http://localhost:8080/hello. The execution will stop at the breakpoint at line 16 in HelloWorldEndpoint.

πŸ‘ Image

Published on Java Code Geeks with permission by Ivar Grimstad, partner at our JCG program. See the original article here: Run and Debug a WildFly Swarm application from NetBeans

Opinions expressed by Java Code Geeks contributors are their own.

Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

πŸ‘ Photo of Ivar Grimstad
Ivar Grimstad
April 13th, 2018Last Updated: April 13th, 2018
0 307 1 minute read

Ivar Grimstad

Ivar Grimstad is an experienced software architect focusing on Enterprise Java. He is participating in the Java Community Process as a member of the Expert Groups for JSR 368 (JMS 2.1), JSR 371 (MVC 1.0), JSR 375 (Java EE Security API). He is also a member of the NetBeans Dream Team.
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Back to top button
Close
wpDiscuz