3 Replies Latest reply on Jul 27, 2013 3:25 PM by henk de boer

    How to debug WildFly (WildFly itself, not e.g. a web app) using Eclipse?

    Juergen Zimmermann Master

      I'm asked to debug WildFly for https://issues.jboss.org/browse/WFLY-1406. However, I'm not having Intellij and jdb looks a little bit cumbersome. I'd appreciate any hint on using the Eclipse debugger.

        • 1. Re: How to debug WildFly (WildFly itself, not e.g. a web app) using Eclipse?
          Tomaz Cerar Master

          Hi,

           

          take a look at https://community.jboss.org/wiki/HackingOnWildFly

           

          that will help you with getting everyhing setup.

           

          but basicly all you do is run

           

          mvn clean install

          or if you don't want to wait for default testsuite you can do

          mvn clean install -DskipTests

          or to run whole testsuite

          mvn clean install -DallTests

           

          as for eclipse goes, make sure you are using latest m2e or even better use kepler, otherwise import of project will take lots of time.

           

          --

          tomaz

          • 2. Re: How to debug WildFly (WildFly itself, not e.g. a web app) using Eclipse?
            Nicklas Karlsson Master

            If you start WF in eclipse in debug mode, you can debug the AS as well.

            I recommend checking out only the subprojects in WG that you need as checking out everything can be a pain in eclipse.

            1 of 1 people found this helpful
            • 3. Re: How to debug WildFly (WildFly itself, not e.g. a web app) using Eclipse?
              henk de boer Master

              This is maybe more of a JBoss Tools question, but as Nicklas says the core thing to do is just starting WildFly in Eclipse in debug mode, with or without an app deployed. Eclipse and the JVM will not distinguish the WildFly code from your own app code. It are all just classes in the JVM.

               

              What you DO need to do is putting the WildFly classes on your classpath and attach the source. You can then put break-points into it, open call-hierarchies etc.

               

              JBoss Tools has an absolutely great feature for this (really someone should give these guys a medal!). Go to Preferences -> Server -> Runtime Environments -> Default Classpath Entries. Choose WildFly 8.0 Runtime (Experimental) from the dropdown. By default it only has the API classes on the classpath, but you can add whatever you want by pressing the Add button and navigating to the /modules/system/layers/base directory of your WildFly installation.

               

              You could theoretically add the entire /base directory, but your classpath will get enormously huge then. Typically you choose some parts your interested in (it may take some time to find out what you really want or need).

               

              After having done that, you can attach the source manually for individuals jars (all artifacts are in the Maven repo). Via grepcode.com it's also easy to find the source jars starting from a specific class. Even easier is to install "JBoss Tools Maven Source Lookup) that in many cases will be able to download the source automatically for you.

               

              Actually changing the code and running your changes is a different story, but for just debugging and investigating the above should be enough!

               

              Happy hacking