Tuesday, October 30, 2012

Debugging a remote application in Eclipse

 Debugging a remote application in Eclipse


I have the source code of a web application in my local Eclipse. While this application is running remotely on the server, can I debug the remote application using my local Eclipse?

Yes, You Can.



How do I debug a remote application in Eclipse?

Refer to this link:
http://www.eclipsezone.com/eclipse/forums/t53459.html

In Summary:

(1)Set Java Debugger in the launch of the application server and restart the server. This is to enable the app server to run in debug mode.

The default JPDA options for J2EE servers are as follows:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000

Adding the above into the server start up screen in Weblogic server console, or add them into weblogic server start up command.
Then restart the server. This would enable WebLogic instance to be running in debug mode.

(2)Go to Eclipse,go to Run | Debug, and Create new Remote Java Application configuration in Eclipse
For Host , enter localhost. To debug a remote server, enter its hostname or IP address. For port, enter 4000 or the port you defined in your WebLogic startup script. click "okay".

Go to "Debug" perspective, set trace points, and rock and roll!



No comments:

Post a Comment