I usually use Orion, and find debugging it from within IntelliJ is great for debugging. You can set breakpoints in EJBs or other server side code, start it with the Debug button and then wait for your breakpoints to be reached. You can then evaluate expressions, recompile classes and so on.
I set out to do the same thing with JBoss, which I am using for my current project and got it working. It works even better than Orion, because Orion’s classes are obfuscated, whereas JBoss’ are not.Step 1 Create a JBoss module
Open File -> Settings -> Paths and create a new Java module as shown below:
(Click to expand)
Step 2 – Add a new Run/Debug Configuration
Add a configuration as shown below.
(Click to expand) Note that the VM parameters do not show up fully in the screen shot. Copy and past the following:
-Xms128m -Xmx512m -Dprogram.name=run.sh -Djava.endorsed.dirs=/convergence/configunit/jboss/lib/endorsed
Using it
- Make sure that JBoss is not running on your machine
- Open Run -> Debug and select the Application tab. Select JBoss and then click on the Debug button. You should see JBoss’ start up messages appearing in the IDEA console.
Update: I had to set this up on a new project and got some errors. After playing with I discovered that it is important to exclude any other modules and classes from the JBoss module. Then it works.
What about the JBoss plugin that exists? It’s worked just fine for me…