Deploying an application to JBoss AS / WildFly with Eclipse

Deploying an application is quite easy and just requires right clicking on the Server icon and choosing "Add and Remove". In the next GUI choose a Java EE application project which will be deployed to JBoss AS and click on "Add" and "Finish".
jboss with eclipse jboss and eclipse tutorial

Fine. In a few seconds your application will be available on JBoss AS.

How to debug your applications running on JBoss AS / WildFly.

The simplest way to debug your Java EE applications on JBoss AS / WildFly is starting the server from within Eclipse in Debug mode. Simply right click on the Server icon and choose "Debug". Once that the compiled code hits a breakpoint, the Debug perspective view will kick in.

The other way to debug, is called remote debugging and happens if you are running JBoss AS on a separate process. In order to remotely debug JBoss AS, set this properties in the AS start script (standalone.conf):

JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"

In the Debug configuration, create a new Remote Java Application node.
In the Connection Properties, specify localhost as the Host and specify the Port as the port that was specified in the run batch script of the JBoss server, 8787.

jboss with eclipse jboss and eclipse tutorial

Please note that WildFly and JBoss EAP use deployment marker files to trigger deployment of applications. By default packaged archives are automatically deployed. On the other hand, exploded archives require a marker file named application.dodeploy to trigger deployment: for example if you are deploying an explodec application named Example.war, then you need creating a file Example.war.dodeploy in the deployments folder.

Fine so we learnt how to create and deploy applications using JBoss and Eclipse. For more development tutorial with JBoss and Eclipse check the development site page.