10 Nov 2009
Debugging across Eclipse workbenches
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.
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.
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:
Finally, hit debug and away you go.


