Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes IDEs, Version Control and other tools and the fly likes Debugging Container code in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Debugging Container code in Eclipse" Watch "Debugging Container code in Eclipse" New topic

Debugging Container code in Eclipse

Gavin Bong
Ranch Hand

Joined: Apr 25, 2003
Posts: 56
Can someone explain what does it take to debug codes that run inside a container of some sort ? By container, I'm talking about components build to the Inversion of Control (IoC) pattern like servlet container, EJB container etc... I basically want to learn how to write a plugin that will allow me to debug EJBs inside Eclipse ? Is this possible ?
Dan Kehn
Dastardly Dan the Author
Ranch Hand

Joined: Jun 11, 2003
Posts: 120
This is John Kellerman's area of expertise, but I'll go out on a limb and suggest that remote debugging your container from Eclipse would work. That's what WebSphere Application Developer (WSAD) does to debug the WebSphere Application Server (WAS) EJB container. This approach is described in Chapter 4, "Debugging Java" in section "Remote Debugging". Here's the first couple of paragraphs:
The Java Debugger allows you to debug programs remotely, including using hot code replace with JVMs that support it. Remote programs include those running on your local machine outside of Eclipse and programs on another machine, either standalone or in a server environment. In order to display a source and enable you to set breakpoints, the Debugger gets the source for the code being debugged from your workspace.
Debugging a remote program is similar to debugging a local one, except that the remote program must be launched first with certain JVM parameters, and you need to specify a Remote Java Application launch configuration. When you launch your remote program with the parameters specified below, it starts and then suspends waiting for a connection from a debugger. The launch configuration contains information for the JDT Debugger to connect to the JVM running the remote program and initiate a debugging session.

The exercise in Chapter 30, "Debugging Java," covers these steps in detail in Section 3. This is also covered in lesser detail in the Eclipse online documentation under Remote Debugging.
-- Dan

Co-author of <a href="" target="_blank" rel="nofollow">The Java Developer's Guide to Eclipse</a>, 2nd Edition<br />(Yahoo group <a href="" target="_blank" rel="nofollow">JDG2E</a>)
Gavin Bong
Ranch Hand

Joined: Apr 25, 2003
Posts: 56
What other JVMs support hot code replace ? I know that IBM's JVMs does. Thanks
Sherry Shavor

Joined: Jul 15, 2003
Posts: 7
Sun JDK1.4 also includes HotSwap, see: JDKSE 1.4.2 release notes
Sherry Shavor

<a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Debugging Container code in Eclipse
It's not a secret anymore!