Tuesday, March 29, 2011
Remote debugging
If a runtime environment is not set up in the local machine, sometimes it becomes difficult to debug some issues. For example consider an enterprise application deployed on a websphere server on a remote machine. If there is an issue reproducible on this environment the developer may not be able to debug and find out what the issue is. This is because the enviroment is remote and developer has the code base on his machine. Developer might have his own development environment say - Tomcat server. However, it is possible to remotely debug the issues existing on the remote production machine. For this, the developer should have the same version of code base in his eclipse as that present on the runtime environment. Once that is confirmed he needs to do the following. In WebSphere web console, left navigation, 1. Servers -> Server Types -> WebSphere application servers 2. Under Server Infrastructure section -> expand Java and Process Management -> Process definition 3. Under Additional Properties section -> click Java Virtual Machine 4. Checked the 'Debug Mode' 5. In Debug arguments textbox, put this -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888 6. Restart WebSphere server instance. Now, WebSphere is started in debug mode, and listening on port 8888. (Later, Eclipse will connect to this port for debugging) In Eclipse IDE, under your project source 1. Click on 'Run', 'Debug Configurations' 2. Select 'Remote Java Application', right click and select 'New' 3. Renamed a new name , e.g 'WebSphere 7 Instance' 4. In 'Connection Type', select default, 'Standard (Socket Attached)' 5. Host, put your WebSphere host IP 6. Port, put 8888. 7. Click on the debug button. Now, Eclipse debugger is started and connected to port 8888. Now, as you run the application on the remote machine, the code can be debugged in single steps. Taken from http://www.mkyong.com/websphere/remote-debugging-with-eclipse-websphere-7/
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment