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

Today’s data climate is fast-paced and it’s not slowing down. Here’s why your current integration solution is not enough. Brought to you in partnership with Liaison 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

Is iPaaS solving the right problems? Not knowing the fundamental difference between iPaaS and iPaaS+ could cost you down the road. Brought to you in partnership with Liaison Technologies.

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 best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

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

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

{{ parent.tldr }}

{{ parent.urlSource.name }}