In general, in the Java EE application development process, everyone is accustomed to using Tomcat as a debugging server, the corresponding in the Eclipse IDE debugging Tomcat is also very simple, you can download the Tomcateclipse plug-in is easy and easy to debug the application in the IDE (see COM.SYSDEO.ECLIPSE.TOMCAT).
However, if the application is enterprise-class and requires an EJB container deployment, Tomcat is powerless, and at this point we can choose the JBoss as as the debug server.
How the application is automatically built and deployed into the deploy directory of JBoss is not the focus of the discussion, and the JBoss Seam-gen generates a project with an ant script that builds the deployment automatically in eclipse and wants to know.
If you want to debug JBoss in the IDE, we need to first look at how JBoss started: in JBoss 4.2.X, for example, the Run.bat in the Jboss_home/bin directory is, in fact, the next two sentences, the key to JBoss startup:
"%JAVA%" %JAVA_OPTS% ^
-Djava.endorsed.dirs = "%JBOSS_ENDORSED_DIRS%" ^
-classpath "%JBOSS_CLASSPATH%" ^
org.jboss.Main %*
Follow the clues, find the variable%jboss_endorsed_dirs% = jboss_home\lib\endorsed,%jboss_classpath% better understand, is actually jboss_home\lib Add the classpath required by the application.
Now that you understand the principle, set up a launch in Eclipse and open the Launch Definition window with the "Open Run Dialog ..." To create a new one.
In "Main class" fill in the Org.jboss.Main, of course, you need to add Jboss-system.jar to the project Classpath. Then fill in the-djava.endorsed.dirs=d:\jboss-4.2.3.ga\lib\endorsed in the ARGUMENTS->VM arguments, so that You can start the JBoss application server in the IDE by running this launch.
Finally, don't forget to set the source code directory in the SourceCode, convenient debug.