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.

Free Resource

Build APIs from SQL and NoSQL or Salesforce data sources in seconds. Read the Creating REST APIs white paper, brought to you in partnership with CA Technologies.

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

The Integration Zone is brought to you in partnership with CA Technologies.  Use CA Live API Creator to quickly create complete application backends, with secure APIs and robust application logic, in an easy to use interface.

Topics:
wildfly ,wildfly swarm ,camel

Published at DZone with permission of Matthew Casperson, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}