Integrate Tomcat remote debugging in eclipse 3.1

Source: Internet
Author: User
Integrate Tomcat remote debugging in eclipse 3.1

Some time ago, when debugging eclipse, a problem occurred. That is, when an eclipse 3.1 remoto application debug was added. The error message is that the remote VM connection attempt failed.

Remote debugging principles ~

Start the start. BAT file of Tomcat

Add a parameter to modify Catalina. BAT in Tomcat/bin.

% _ Execjava % java_opts % catalina_opts % debug_opts %-xdebug-xrunjdwp: Server = Y, transport = dt_socket, address = 8000, suspend = N-djava. endorsed. dirs = "% java_endorsed_dirs %"-classpath "% classpath %"-dcatalina. base = "% catalina_base %"-dcatalina. home = "% catalina_home %"-djava. io. tmpdir = "% catalina_tmpdir %" % mainclass % cmd_line_args % action %

There is an address = 8000 indicating the port number for debugging in the initate.

Start eclipse and add a remoto Java application in "-> debug". Enter the IP address of your application server in the host. Enter the debug port number set in tomcat in "Port ~ 8000 and then debug it directly.

Add several segments in the code ~ Then you can debug it.

 

------------------------------------------------------------

Set two environment variables before starting Tomcat

Cd % catalina_home %/bin
Set jpda_address = 8000
Set jpda_transport = dt_socket
Startup
The best way is to create a BAT file with the following content (assume that your catalina_home address is D:/tomcat-5.5.9 ):

 

Code
  1. Set jpda_address = 8000
  2. Set jpda_transport = dt_socket
  3. Cd d:/tomcat-5.5.9/bin
  4. Catalina JPDA start

 

In eclipse, select Run --> Debug. On the displayed page, select remote Java application on the left. Enter a project name in the Name field on the right and enter the name of the project to be remotely debugged. HOST: localhost Port: 8000 (these eclipse will automatically help you fill in)

 

 

 

 

 

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.