Remote Debugging in Eclipse
Reference: http://www.jacoozi.com/index.php?option=com_content&task=view&id=119&Itemid=134
Configuring WAS:
1. Open WebSphere 5.X/6.X Console
2. Navigate to Servers | Application Servers | [SERVERNAME] | Process Definition | Java Virtual Machine
3. Check Debug Mode
4. Arguments can be edited in the field called Debug arguments.
You can paste this line and use the same port 7777 to debug from Eclipse:
-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777
Check if the port is up via commandline:
type netstat -a
check if port 7777 is in listening state
Configuring Eclipse:
1. In Eclipse, navigate to Run | Debug (See Figure)
2: Create new Remote Java Application configuration in Eclipse).
2. Select Remote Java Application, on the left column. Click New, on the bottom of the same column. 3. In the Create configuration screen you'll be prompted to enter some values. For Project, select the Java project that contains the source code you want to debug. Leave Connection Type in default, i.e. Standard (Socket Attach).
For Host, enter localhost. If you want to debug a remote server, enter its hostname or IP address. For port, enter 7777 default for websphere app server. e.g.
Host Set to VM IP Address
Port Set to port specified in WAS
4. Click Apply
5. Make sure Websphere instance is running in debug mode. In the same screen click Debug. Eclipse should automatically take you to the Debug perspective and you should see a stack trace in the Debug view.
6. If you are not automatically taken to the Debug perspective, select Window | Open Perspective | Other and then click Debug.
0 Comments:
Post a Comment
<< Home