How to debug JBoss applications in eclipse

Source: Internet
Author: User
Tags jboss jboss application server

Generally, Java EE applicationsProgramIn the development process, everyone is used to using
Tomcat serves as the debugging server, corresponding to
Debugging tomcat in IDE is also very easy. You can download the tomcateclipse plug-in to easily debug applications in IDE (see
Com. sysdeo. Eclipse. Tomcat ).

However, if the application is enterprise-level and requires EJB container deployment, Tomcat will be powerless. At this time, we can select JBoss as the debugging server.

How to automatically build and deploy the application to the deploy directory of JBoss is not the focus here. The project generated by JBoss Seam-gen contains the ant script for automatic building and deployment in eclipse, for more information, see.

To debug JBoss in IDE, we need to first check how JBoss is started: Take JBoss 4.2.x as an example, run. bat has the following two statements:

 

"% Java %"
% Java_opts % ^

-Djava. endorsed. dirs =
"% Jboss_endorsed_dirs %"
^

-Classpath
"% Jboss_classpath %"
^

Org. JBoss. Main % *


Find outVariable % jboss_endorsed_dirs % = jboss_home/lib/endorsed,
% Jboss_classpath % is better understood.
Jboss_home/lib and the classpath required by the application.

Now that you understand the principle, set a launch in eclipse, open the launch definition window through "Open Run dialog...", and create it.

In "Main class", enter org. JBoss. Main.
Of course, you need to add the jboss-system.jar to the classpath of the project. Then in arguments-> VM arguments
-Djava. endorsed. dirs = D:/jboss-4.2.3.GA/lib/endorsed
In this way, you can run this launch to start the JBoss application server in the IDE.

Finally, do not forget to set it in sourcecodeSource codeDirectory to facilitate debugging.

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.