Remote debugging of eclipse (JBoss + Tomcat)

Source: Internet
Author: User

What is remote debugging? We usually debug the JavaCodeYou need to integrate your web server with your development tools (such as Eclipse) or some plug-ins (such as myclipse in eclipse ), these methods are implemented locally, that is, your development tools and web servers run on the same server, if your development tools and servers are no longer on one machine, you need to implement remote debugging.

The following describes how to implement remote debugging in Tomcat:

Add the following settings to the Catalina. BAT file of Tomcat. Of course, the set catalina_opts variable should be used before. This is to set some virtual machine parameters during Tomcat startup so that the server can allow remote connection. Address = 5006 indicates the port number for remote connection and can be set to any other non-conflicting port.

Find "echo using java_home: % java_home %" in Catalina. BAT and add the following to it:
Set java_opts =-xms256m-xmx512m % java_opts %
Set java_opts =-classic-xdebug-xnoagent-djava. compiler = none-xrunjdwp: Transport = dt_socket, address = 5006, Server = Y, suspend = n % java_opts %
Then explain the remote debugging implementation in JBoss:

It is relatively simple to configure remote debugging in jobss. The principle is the same as that of Tomcat. It also changes the Virtual Machine Parameters in the form of port 8787. Do not repeat the ports.
Open the run. conf file in the jboss_home/bin directory and find:

# Java_opts = "$ java_opts-xdebug-xrunjdwp: Transport = dt_socket, address = 8787, Server = Y, suspend = y"

Modify it:

Java_opts = "$ java_opts-xdebug-xrunjdwp: Transport = dt_socket, address = 8787, Server = Y, suspend = N"

8787 indicates the debug port number;

In this way, you can restart the Web server and start it independently without starting it in the plug-in of elasticsearch. Open the debug settings window in eclipse, select remote Java application, create a debug item, enter the Server IP address and the configured port number, and click OK to enter the debug status. You can also set remote Java application in JBuilder.

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.