Debugging code deployed on a server using Eclipse mate JDWP

Source: Internet
Author: User

Today, there is a problem: the same code, running on the server will be reported null pointer exception, but there is no problem in the local, look at the server print logs can only see the exception information, can not accurately locate the problem code, so the search for a bit of remote debugging. As a result, you can actually remotely debug the code on the server in eclipse

There is a protocol called JDWP that supports remote debugging of Java virtual machines

The full name of JDWP is the Java Debug Wire Protocol, which defines the communication protocol between the debugger (debugger) and the Java Virtual machine (target VM) being debugged. Its core API is already included in the JDK.

The method used is to add something like the following on the JVM's startup parameters:-xdebug-server-xrunjdwp:transport=dt_socket,server=y,address=8899 ( 8899 of these are my own defined port numbers, which can be changed to other port numbers as needed .

Settings in eclipse: Click Run-->debug Configurations Right-click on the Remote Java application option on the left to select NEW (as shown)

Select the project to be debugged in project, the host is populated with the server's IP address, and port is the port number in the JVM boot parameter we configured on the server

Start the project on the server, the server waits for the debugger to connect (the project is waiting and does not start), and in Eclipse (the location in the picture) Click the Debug button and the project on the server starts so that it can be debugged remotely in eclipse

For more detailed information, refer to this article on IBM Developworks: http://www.ibm.com/developerworks/cn/opensource/os-eclipse-javadebug/

Debugging code deployed on a server using Eclipse mate JDWP

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.