Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Debugging Wildfly Swarm Applications in Intellij

DZone's Guide to

Debugging Wildfly Swarm Applications in Intellij

Learn the steps to quickly setup up IntelliJ to debug your WildFly application remotely.

· Integration Zone ·
Free Resource

How to Transform Your Business in the Digital Age: Learn how organizations are re-architecting their integration strategy with data-driven app integration for true digital transformation.

Once you start developing apps in WildFly Swarm, you’ll soon find yourself wanting to step through your code to debug issues that may arise. But how do you do that given that the environment that runs your code isn’t available until you build it?

Typically you debug WildFly applications by configuring a WildFly instance that is run by IntelliJ with your applications inside it. To debug a WildFly Swarm application, you need to use IntelliJ’s ability to debug remote applications.

Click Run -> Edit Configurations...

Screen Shot 2016-04-13 at 2.43.11 PM.png

Then click the plus icon in the top left hand corner of the dialog, and select the Remote option.

Screen Shot 2016-04-13 at 2.43.27 PM.png

You can accept all the defaults here. All you need to do is give your configuration a name. But before you close the dialog, grab a copy of the For JDK 1.4.x string. Mine was:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

Screen Shot 2016-04-13 at 2.43.43 PM.png

Click OK to close the dialog and save your changes.

Now you can run your Swarm application with the options supplied by IntelliJ. I run the sample project from this article with this command:

java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 build/libs/swarmdemo6-swarm.jar


Once you application is running, you can debug the remote configuration you just created.

Screen Shot 2016-04-13 at 2.52.28 PM.png

This will connect to the Swarm application you just started, and step through the code like any other application you would debug with IntelliJ.

Note in the screenshot below I have set a breakpoint in my CDI bean, and can inspect the variables that were passed in.

Screen Shot 2016-04-13 at 2.53.40 PM.png

Make your mark on the industry’s leading annual report. Fill out the State of API Integration 2019 Survey and receive $25 to the Cloud Elements store.

Topics:
wildfly ,wildfly swarm ,camel

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}