How do you connect an eclipse to a WebSphere Application server hosted on remote server?

user1172766 picture user1172766 · Jan 27, 2012 · Viewed 44k times · Source

I am trying to debug a local code ( which is on my laptop) using eclipse, which I am trying to connect to the remotely hosted WAS( WebSphere Application server) and remotely hosted database.

Answer

shelley picture shelley · Jan 27, 2012

To remotely connect to WAS, first, from the WebSphere Integrated Solutions Console:

  1. Navigate to the application server's Debugging Service:
    • Servers > Server Types > WebSphere application servers > [serverName] > Debugging Service
  2. Check the "Enable service at server startup" checkbox
  3. Add/modify the "JVM debug port" if necessary (the port must not already be in use on the server)
  4. Add/modify the "JVM debug arguments" if necessary (this may already appear by default):
    • -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777
  5. Apply the changes, Save the new configuration, and Restart the application server

Then, from the Eclipse IDE:

  1. Open the "Debug" dialog (e.g. Run > Debug Configurations...)
  2. Right-click "Remote Java Application" and select "New"
  3. Configure the Remote Java Application:
    1. Name the debug configuration
    2. Browse to select the project to debug (optional)
    3. Use the "Standard (Socket Attach)" Connection Type
    4. Specify the hostname of your WAS server
    5. Specify the port number that was set in the WAS debug options
  4. Click Apply
  5. Click Debug

(These instructions are for WAS 7.0, but should be similar for other versions.)