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.