10 Nov 2009

Debugging across Eclipse workbenches

Posted by gavin

One annoying part of developing Eclipse plugins which generate deployable JEE applications is that the server you use for deployment is often set up and started through the runtime workbench.

This means that to test your code, you need to configure the code lookup in your runtime workbench – a pain if you have multiple runtime workbenches, or frequently clear your runtime workbench metadata.

An alternative approach, which I use, is to disconnect the debugger from the runtime workbench and connect it in your base workbench. This post details how.

The first step is to find out what port your server’s debug process is listening on. The default for WebSphere Application Server is 7777, but this might change if you’ve either customised it or configured multiple server instances. An easy way to check is to select the “debug” view in your Eclipse runtime workbench.

Debug View

Debug View

In this picture, you can see that my WAS instance is running on port 7778. Make a note of this number, then select (in this view) the server (either of the top 2 lines), and click the disconnect icon (the red ‘N’ with 2 blobs icon). This disconnects the runtime workbench’s debugger from the server, freeing up the server’s debug port for another application i.e. your base workbench.

New config

New config

Next, we need to create a runtime configuration in the base workbench to connect to the server. Open the debug configurations dialog (Run->Debug Configurations), and select “Remote Java Application”, then click the new button. All you really need to change from the default settings are the name (if you want to be able to remember it) and the port (to the port you wrote down earlier). Here’s mine:

Settings

Settings

Finally, hit debug and away you go.

VN:F [1.9.6_1107]
Rating: 10.0/10 (2 votes cast)
Debugging across Eclipse workbenches, 10.0 out of 10 based on 2 ratings
  • Print
  • Add to favorites
  • Facebook
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Twitter
  • Digg

Tags: , , , ,

Leave a Reply

Message:

  • Browse

    or
  • Latest Content

  • Gallery

    2009_1211XmasDinner0023 2009_1211XmasDinner0007 IMG_7116 2008_0320Dublin0138
  • Tags

  • RSS<img src="http://www.gavinwillingham.com/wp-content/plugins/twitter-widget-pro/twitter_logo_s.png" height="21" width="92" alt="twitter logo" />

  • Comments