Teach you to debug JBoss application in Eclipse

Source: Internet
Author: User
Tags jboss jboss application server tomcat

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.