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